Line Based Generic model

Hi Everyone,
I have a line based generic model family (.rfa). Could anyone tell me how to use it in dynamo? For example, I have its endpoints: A (0,0,100) vs B(0,100,100).Based line Generic Model.rfa (284 KB)

Hi Hoc,

Are you looking to place family by End points?
Or you want to use this family to draw a solid element by points?

Hi Kulkul,
I was looking for a guide to use line-based family. However, I can do it now. Thank you very much.

For the benefit of others who might have a similar query, could you please post your solution.

Sure! the solution is based on Kulkul suggetion. Instead of using line-based family, we can use a generic model (.rfa) and set a parameter for its length. Now, it is quite similar to line-based family. Of course, we should use “FamilyInstance.ByPoint” to place it in model.

Actually, don’t you think, a two point Adaptive component family will better mimic a line based family.

Adaptive component is a good choice but it may make the model size much larger.

@Vikram_Subbaiah and @Hoc_Em,

You can use Python to place the Line Based Generic Model family. The correct overload for that is this:

f = doc.Create.NewFamilyInstance(locationLine, familyType, level, StructuralType.NonStructural)
f.Location.Curve = locationLine

I have also set the Location property of the family instance after its creation as you can see above. It seemed to be necessary when I was working on this, but I might be wrong on that.

Also, the trick to this working on generic models and not a beam - which all examples are showing - is to set the structural type to non structural.

Cheers!

1 Like

On practically the same lines outlined by @Konrad_K_Sobon , here is a non Python approach …

  • First change the Family Category in the line based family file

-Then in Dynamo…

EDIT:
To address the concern about having all line based families as Structural framing, once the families are placed, the Family Category can be changed back to what it was earlier and reloaded into the project.

@Vikram_Subbaiah +10 for creativity and -10 for usability. I mean we are supposed to be making things easier and cleaner, and instead this is really muddying up the water here. I don’t think anyone wants to have every line based family be Structural Framing just because Dynamo doesn’t have a OOTB node that places other family types. Your approach is kinda cool, but really generates quite few issues down the line so I cannot endorse it.

1 Like

@Konrad_K_Sobon I wouldn’t endorse it either.
Just a possible work around for the Python illiterate :slight_smile:

1 Like

The Clockwork package has had a “FamilyInstance.ByCurve” node for a very long time now, you should give that a try.

1 Like

Hi Everyone, and thanks in advance for any pointers;

I was trying to make this node work but the python is telling me in the family creation method it is expecting and XYZ and I’m feeding a curve, which was the whole point.

The only method I have seen in the API that lets you use a curve is:

NewFamilyInstanceCreationData Method (Curve, FamilySymbol, Level, StructuralType)

But if I try to use it the Python tells me:

AttributeError: ‘Document’ object has no attribute ‘NewFamilyInstanceCreationData’

Any ideas?

Thanks again

I’m sure I’m doing things wrong

The problem was that I was feeding it a list of levels.

If I just feed one it seems to work.

I’ll try modifying the code to work with several levels.

Also the designscript code" curve : Autodesk.Curve;" is throwing an array rank reduction error.

That node appears to be broken in Dynamo 1.3.1 / Revit 2018. It only ever returns a null value.