tag:blogger.com,1999:blog-23382408.post8711652223470685461..comments2023-07-21T15:51:24.097-04:00Comments on CAD Application Development: Revit 2008 API: New Creation Capabilities, Newly promoted ObjectsMatt Masonhttp://www.blogger.com/profile/13505746985622750229noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-23382408.post-65881298437122293952007-11-06T13:55:00.000-05:002007-11-06T13:55:00.000-05:00Yeah it is bizarre. It appears to happen when I l...Yeah it is bizarre. It appears to happen when I load an external family. Once I load one up, my code will not get called again. I will let you know if I figure it out.Unknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-41465086488924431352007-11-06T13:51:00.000-05:002007-11-06T13:51:00.000-05:00James,I have not seen that.The only time I've ever...James,<BR/><BR/>I have not seen that.<BR/><BR/>The only time I've ever seen something which is on the menu be present, but not run anything when you click on it, is when the referenced assembly or classname did not exist.<BR/><BR/>It doesn't sound like that's what's happening to you - so I'm stumped.<BR/><BR/>-MattMatt Masonhttps://www.blogger.com/profile/13505746985622750229noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-3780703733524422492007-11-06T13:47:00.000-05:002007-11-06T13:47:00.000-05:00Hey Matt, Thanks for the help, I am starting to ...Hey Matt,<BR/> Thanks for the help, I am starting to work through what I might be capable of doing. One thing that has been driving me nuts that I wanted to ask you. Do your external applications ever just start not running? Mine will be running fine for a while, and then eventually I will click on them in the External Tools menu and nothing will happen. If I am in debug mode, it will not jump into the code, if I am in release mode nothing. No error or anything. Have you seen this at all?<BR/><BR/>Thanks!<BR/><BR/>JUnknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-72325870699913130642007-10-30T08:31:00.000-04:002007-10-30T08:31:00.000-04:00James,That's a tough one - with the way Revit and ...James,<BR/><BR/>That's a tough one - with the way Revit and its API work today.<BR/><BR/>Off the top of my head, here's a couple disjointed thoughts:<BR/><BR/>1. I don't know how good you are at development of "good" Revit families - I think much of what you're talking about requires a very well-defined parametric Revit Family... but that's possible.<BR/><BR/>2. In the "smart-family" you'll probably have to make a bunch of the parametric dimensions, component switches, etc be instance parameters (because I suspect you'll be changing them on an instance basis rather than a "type" basis).<BR/><BR/>3. I'm pretty sure that there's no way currently to create a new FamilySymbol - so you have to work with the ones you have - either selecting the proper one, or tweaking the parameters on it to make what you want. (or make the driving parameters into instance parameters so that they can be set for each instance).<BR/><BR/>All in all, it's a tough road, but you might be able to make something that makes sense.<BR/><BR/>You might also try out the idea on manufactured or custom home builders (who also need a great deal of quick window selection/configuration).<BR/><BR/>Best Regards,<BR/>MattMatt Masonhttps://www.blogger.com/profile/13505746985622750229noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-90902378280338733242007-10-29T22:36:00.000-04:002007-10-29T22:36:00.000-04:00Hi Matt,Another question for you. To frame it, th...Hi Matt,<BR/>Another question for you. To frame it, this is what I am trying to do: create an external application that could allow for a bit of complex configuration of windows before inserting them into Revit. In the past I have done some contract work that leads me to believe that architects could use this type of functionality for issues like grille alignment. Families appear to make this type of complex case difficult. So I was thinking about having an external app be able to do a lot of the heavy lifting and when I am done, insert the window into my project. In order to do this I wanted to procedurally generate the family (which isn't possible). My next idea was to create a generic family that I would insert the window as. In order to do this, I would need to at least be able to specify a type and also throw out all the components in the family and regenerate them based on dimensioning from my application.<BR/><BR/>Anyway, that is a verbose comment, but I am wondering what your take on such a project would be. You seem to be one of the few in the know folks concerning the Revit API at this point that I can find.Unknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-28767595522777169092007-10-29T17:46:00.000-04:002007-10-29T17:46:00.000-04:00Hi Matt, That is perfect. Where I was getting h...Hi Matt,<BR/> That is perfect. Where I was getting hung up was specifying the family type/symbol. Thanks for the help.<BR/><BR/>JamesUnknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-62943769354867167192007-10-29T16:56:00.000-04:002007-10-29T16:56:00.000-04:00James,Here's a sample of how I've done it in the p...James,<BR/><BR/>Here's a sample of how I've done it in the past. The trick is that you have to get the right family type (aka Family Symbol), then use that to make a new family instance, with the wall as the host element:<BR/><BR/>(my apologies for the formatting of this - it looks nasty when it's only 25 characters wide).<BR/><BR/><B> <BR/><BR/>// Make a wall, just to work with. <BR/>Autodesk.Revit.Elements.Wall w1 = doc.Create.NewWall( app.Create.NewLineBound( new Autodesk.Revit.Geometry.XYZ(0,0,0), new Autodesk.Revit.Geometry.XYZ(0,100,0) ), doc.ActiveView.GenLevel, false );<BR/><BR/>// Get the family symbol for the door I want Autodesk.Revit.Symbols.FamilySymbol fs = getSymbol( doc, "Single-Flush", "36\" x 84\"" );<BR/> <BR/>// place it Autodesk.Revit.Elements.FamilyInstance fi = doc.Create.NewFamilyInstance(new Autodesk.Revit.Geometry.XYZ(0, 50, 0), fs, w1, doc.ActiveView.GenLevel, Autodesk.Revit.Structural.Enums.StructuralType.NonStuctural);<BR/><BR/><BR/> private Autodesk.Revit.Symbols.FamilySymbol getSymbol( Document doc, string family, string symbol )<BR/> {<BR/> string upperFamily = family.ToUpper();<BR/> string upperSymbol = symbol.ToUpper();<BR/> ElementFilterIterator efi = doc.get_Elements( typeof( Autodesk.Revit.Elements.Family ) );<BR/><BR/> while (efi.MoveNext())<BR/> {<BR/> Autodesk.Revit.Elements.Family fam = (Autodesk.Revit.Elements.Family)efi.Current;<BR/> if (fam.Name.ToUpper() == upperFamily)<BR/> {<BR/> Autodesk.Revit.Symbols.FamilySymbolSetIterator fss = fam.Symbols.ForwardIterator();<BR/><BR/> <BR/> while (fss.MoveNext())<BR/> {<BR/> Autodesk.Revit.Symbols.FamilySymbol fs = (Autodesk.Revit.Symbols.FamilySymbol)fss.Current;<BR/><BR/> if (fs.Name.ToUpper() == upperSymbol)<BR/> {<BR/> return fs;<BR/> }<BR/> }<BR/><BR/> return null; // found family but no symbol<BR/><BR/> }<BR/><BR/> }<BR/><BR/> return null; // found no family<BR/><BR/> }<BR/></B>Matt Masonhttps://www.blogger.com/profile/13505746985622750229noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-34984763440810021752007-10-29T16:30:00.000-04:002007-10-29T16:30:00.000-04:00Hi Matt, Thanks for the reply, but I still have ...Hi Matt,<BR/> Thanks for the reply, but I still have the question of "can you place doors/windows into existing walls programmatically?". When creating new family instances, I can't determine how to create that instance as a window.<BR/><BR/>ThanksUnknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-66581145410185134792007-10-29T16:11:00.000-04:002007-10-29T16:11:00.000-04:00James,Can I clarify your question?If your question...James,<BR/><BR/>Can I clarify your question?<BR/>If your question is "can you place doors/windows into existing walls" - then the answer is yes. You can make New Family Instances for almost all of the types.<BR/><BR/>If your question is whether you can programmatically create new families containing doors/windows? Then the answer is no, sorry.Matt Masonhttps://www.blogger.com/profile/13505746985622750229noreply@blogger.comtag:blogger.com,1999:blog-23382408.post-75083012909991257782007-10-29T15:36:00.000-04:002007-10-29T15:36:00.000-04:00Hi Matt, So do you know if creation of windows a...Hi Matt,<BR/> So do you know if creation of windows and doors is able to be supported in any fashion in the current version of the SDK? I am interested in creating window and door elements, but don't see how that is currently possible, which is a shame.<BR/><BR/>Thanks<BR/><BR/>JUnknownhttps://www.blogger.com/profile/08638629995283259228noreply@blogger.com