Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access ModelLine in RFA Family

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
josealberto.torres
174 Views, 2 Replies

Access ModelLine in RFA Family

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
Labels (4)
2 REPLIES 2
Message 2 of 3

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
Message 3 of 3

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Rail Community