Creating a line based family instance?

Hi all,

what is the simplest way to have Dynamo place an instance of a line based family?

Something with these arguments: family type, point1, point2. Maybe also “view name” if using a detail family?

 

thank you

regards

Giovanni, by now do you have an anwer to this question? I am looking for an answer to this one as well! Anyone else maybe?

See link below:

This is the code snippet for how to achieve this. Note that you will also have to define a work plane and ensure that the resulting curve is visible in view (so always run from an active 3d view). I currently don’t have time to translate this to Python but it should be fairly straight foward if you have some experience working with the API.

Unfortunately I am not very experienced. Even Dynamo is a challenge for me at this point, but I’m trying through trial and error. As mentioned in another post of mine, I am looking to create the insertion start and end point for the line based detail component using dynamo at the start and end point of a door or window opening (drawing on top of it)

 

Cheers

Ben,

That link you provided has an example that uses doc.FamilyCreate.NewFamilyInstance() method. That method is only available in a Family Document and not in a project document. Now, Revit SDK doesn’t exactly state what is the proper method for creating a line based Generic Model family or Beam family that has a Curve as its Location Curve. I have had good results using doc.Create.NewFamilyInstance(locationLine, familySymbol, None, StructuralType.NonStructural). This method works fine for Generic Models that are line based. For a Structural Beam you want to actually assign a Structural Type, otherwise the family created will be null and you won’t be able to select it.

Good luck!

2 Likes

Thank you for sharing!