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
Solved! Go to Solution.
Solved by josealberto.torres. Go to Solution.
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
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.
Can't find what you're looking for? Ask the community or share your knowledge.