How to Retrieve Symbolic Curves from a Family Instance?

How to Retrieve Symbolic Curves from a Family Instance?

Anonymous
Not applicable
2,664 Views
7 Replies
Message 1 of 8

How to Retrieve Symbolic Curves from a Family Instance?

Anonymous
Not applicable

I am using the  "get_Geometry()" method to retrieve the full geometry of a family instance.

https://www.revitapidocs.com/2015/380d4823-fbbd-e73b-9358-51f704a5fa1f.htm

 

Then, I am using the "GetSymbolGeometry()" or  "GetInstanceGeometry()" methods to obtain the individual geometrical components of this family(solid, lines etc).

https://www.revitapidocs.com/2015/84ba2e4c-e22a-a12c-c632-1d3dc7edb4c1.htm

https://www.revitapidocs.com/2015/78c57647-ef0f-2d9d-2e16-d221fd5255c2.htm

 

The problem is that neither of the above functions report any of the symbolic lines of that family. (Annotation lines that are not visible in the 3D View).

 

Is there are way I can get those symbolic lines?

 

My ultimate goal is to identify the object styles subcategories of the symbolic those lines which are not in use in the model, to delete and clean the Revit model. 

 

Any advise will be much appreciated.

 

Kind regards,

Alexandros

0 Likes
2,665 Views
7 Replies
Replies (7)
Message 2 of 8

jeremytammik
Autodesk
Autodesk

When you query the element geometry, you can specify the view to get it for.

 

If the annotation you want is not visible in the 3D view, then do not specify the 3D view, and also do not specify no view at all, since it will probably default to 3D.

 

Specify a view that displays the desired annotation and the Geometry property will probably return it as expected.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 8

Anonymous
Not applicable

Hi Jeremy,

 

Many thanks for your message.

 

I am not sure how the methods I previously mentioned (GetGeometry, GetSymbolGeometry, GetInstanceGeometry)

could be related to a view. I couldn't find any of them to have a view input variable in the Revit API.

 

I am just using the "GetElement" Method to select the family instance  providing its Element's Id.

 

The 2D symbolic lines of the family instance I would like to select is not visible in the 3D view, however other 3D geometry of the same family is visible.

 

For clarity, I am also attaching a family which have 3 elements, a 3D box, a model line and a symbolic line. The 3D box and the model line is possible to be selected by Revit API. I am currently unable to select the symbolic line which is only visible in a 2D view.

 

Symbolic Line.jpg

 

Regards,

Alexandros

0 Likes
Message 4 of 8

jeremytammik
Autodesk
Autodesk

Use the Element.Geometry property and specify the view:

 

https://www.revitapidocs.com/2020/d8a55a5b-2a69-d5ab-3e1f-6cf1ee43c8ec.htm

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 8

Anonymous
Not applicable

Hi @jeremytammik, many thanks for your Answer. I used the "Geometry" method as you recommended and together with a plan view reference at the options, I managed to get the Symbolic lines Geometry.

2020-06-04_17-46-59.jpg

 

However, I am now facing the two following issues:

 

1.I cannot find a way to distinguish which lines are model lines and which model lines. Both lines are indicated as "Autodesk.Revit.DB.Line" elements. Is there  any way we can identify if lines are symbolic lines?

 

2.I find it very difficult to get symbolic lines from elements which are place on the Family's elevation views when elements are randomly oriented and those are not perpendicular to my existing elevation views. As I explained earlier my aim is to be able to select all family geometries and purge their Object Styles (subcategories) that are not in-use. I am searching for a way to easily select all symbolic lines from families which are not perpendicular to my elevation. If there is no holistic way to select those elements and we need to have a view as a reference, I believe this is a significant lack of Revit API and needs to be addressed.

 

Kind regards,

Alexandros

0 Likes
Message 6 of 8

lukaskohout
Advocate
Advocate

1. You can try use GraphicStyleId to differentiate. But that means that you have to know which Subcategories contain Model Lines and which Symbolic Lines.

 

2. You can always go directly to family and see the categories it uses. It will be a bit slower but still manageable I guess. Store the subcategories not in use in a List and after the iteration through all families delete these subcategories in project.


Hitting Accepted Answer is a Community Contribution from me as well as from you.
======================================================================
0 Likes
Message 7 of 8

Anonymous
Not applicable

@lukaskohout Thanks again for your reply.

 

1. I would expect Revit API to be able to distinguish the model lines from the symbolic lines the same way it differentiates the Autodesk.Revit.DB.ModelCurve from the Autodesk.Revit.DB.SymbolicCurve element class. the two elements have a completely different way they show up in the views due to their visibility settings and I think this needs to be developed further in the API.

 

2. Indeed, I can retrieve the symbolic lines from opening one by one all the families, however, this will be a much more complicated process to automate, as I will have first to export all families and all the nested tree of sub-families that currently exist in my model. I also find is very difficult to believe that Revit API does not allow to open families without exporting them first and save in a drive.

0 Likes
Message 8 of 8

lukaskohout
Advocate
Advocate

1.

Well, you need to understand that what you see in project view is just some geometric representation of the family not family itself. That is why you are retrieving it by Element.Geometry property. And the representation is created only from geometric elements - lines, faces and so on. Not by API Elements like SymbolicCurve and ModelCurve - you can get them when you open the family and snoop it.

 

2.

You should not need to export the families, you should be able to open them directly from the project.

 

Document fDoc = doc.EditFamily(family);

 

Then you can proceed as in project to get all symbolic a model lines


Hitting Accepted Answer is a Community Contribution from me as well as from you.
======================================================================
0 Likes