Access ModelLine in RFA Family

Access ModelLine in RFA Family

josealberto.torres
Contributor Contributor
282 Views
2 Replies
Message 1 of 3

Access ModelLine in RFA Family

josealberto.torres
Contributor
Contributor

I cannot access a ModelLine located within a family (The one I indicate in the image)
I have other families with the same line and I access them from FamilyInstance.get_geometry([view]) without problems. It is at the first level of objects.

 

RFA file attached

 

 

RFA_Line.png

Graitec - Spain
0 Likes
Accepted solutions (1)
283 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

For me, your formulation and especially the title of your post are a bit misleading.

  

To answer the question suggested by the title, I would answer: in the RFA family document, use a filtered element collector to select all model curve elements and then filter out the one you need from those.

  

However, when you mention FamilyInstance.get_geometry, you apparently mean something completely different. 

  

I assume you are not trying to access a model line in the RFA, but the family instance geometry in the projects file that results from that line in the family definition.

  

For that, FamilyInstance.get_geometry is probably the right way to go, and probably also the only way. Maybe it will help to set the Options.IncludeNonVisibleObjects property to true when retrieving the geometry?

  

https://www.revitapidocs.com/2024/0d277b80-d5e5-1151-d413-b0899da0976f.htm

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

josealberto.torres
Contributor
Contributor
Accepted solution

Hello Jeremy.
Thank you very much for your prompt response.

FamilyInstance.get_geometry() was the correct way as you indicated and I was already testing.
But the problem arose because, even having "Options.IncludeNonVisibleObjects" the ModelLine did not appear as it was invisible in the family. I checked the Visible box and it already appeared.
I see that "Options.IncludeNonVisibleObjects" affects several elements that could be not visible, but in this case it did not display the ModelLine, I had to make it visible before editing the family.

Graitec - Spain
0 Likes