Get Geometry of a family which has detail item

hi guys
i’m trying to retrieve the geometry of a family element which has only one detail element

the result is


No geometry

but while i snoop i can see the solid geometry help me out

When accessed via Dynamo, detail components do not have geometry but their family types do.

A few things to note:

  1. This means that instance parameter based transformations are not taken into account via the geometry (such as the length of a line based detail component), and the shapes must be scaled after the fact.
  2. The resulting shapes often have false flag errors which show during the geometry conversion. My warning effectively stated “it wasn’t clear which version of geometry conversion to use so results may not be correct.”
  3. Geometry is placed at the overall origin as you’re pulling it from the family type which has no transforms applied instead of the instance origin. As such you’ll have to apply the transform coordinates from the instance AFTER you apply any instance based geometry transformations (otherwise scaling stuff like a filled region is MUCH harder).
  4. You’ll need to have a complete understanding of the family, including it’s internal origin and how the family was built in order to leverage this at scale in a project environment.
1 Like

Hi Jacob
I tried this already and checked once again but the result is same


I have attached the family file
Thanks in advance

Are you doing this in the family file or in a project?

family loaded into project

Ah. You’re using a detail item inside a model item. These are excluded typically. I’ll see what I can dig up but this may not be possible with your current family setup.

2 Likes

Looks like you’re going to have to go a full API route so you can specify which view to pull detail items from, and even then it may not pull the info you really want.

I’d instead look at other means of pulling what you are likely after:

2 Likes

Thanks jacob
This may work out for this particular family but it is not generic solution i have different families of the different shape in same template

Then likely you’ll have to move to using another method of modeling your content, or build a custom node to expose that content. Short of that you can get the topmost face of the model content and work with that after pulling onto the desired plane; get all model content and project onto a plane to create surfaces (this could be VERY computationally taxing), or if stuff is really complex creating a detail component which has the shape and flexibility you need and placing that programmatically atop your other current family instances and pull the content from there. Wish I had better news for you.

1 Like

Hope this works Thanks Jacob

1 Like

What is the category of your family ? If it is a Generic Annotation or a Detail Item category, it is possible to retrieve the 2D geometry in the correct location with the help of the API.



FamilyInstance Get Geometry.dyn (2.1 KB)

2 Likes

It’s classified as furniture in this case. :frowning:

1 Like

Jacob is Right but your reply help to understand more clearly thanks Alban :+1:

The masking regions don’t appear to be supported by the API.
So the solution from @jacob.small is therefore the only one.

The geometry of the symbolic lines can however be retrieved if necessary.


3 Likes

Hi Alban it’s Not Working


Please review the family file below
Conference Table NEW.rfa (420 KB)

EDIT :

Looks like I was too quick in my tests. See the post by @c.poupin below.

2 Likes

Alban thanks a lot for spending time on it this is one of a sample i have many families similar to this…so this wont work. but thank a lot have a good day

hello,
a Python solution with specify the view in Geometry Option (the detail elements are only visible on certain views)

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)


clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

elem = UnwrapElement(IN[0])

outsurface = []
outedges = []
outlines = []

#get the actual view where the Detail Element is Visible
view = doc.ActiveView
op = Options()
op.View = view
geoms = elem.get_Geometry(op)
for geoinst in geoms:
	if isinstance(geoinst, GeometryInstance):
            geosymbs = geoinst.GetInstanceGeometry()
            #or only get Symbolgeometry 
	        #geosymbs = geoinst.GetSymbolGeometry()
		for geoelem in geosymbs:
			if isinstance(geoelem, Solid):
				for face in geoelem.Faces:
					outsurface.extend(face.ToProtoType())
				for edge in geoelem.Edges:
					outedges.append(edge.AsCurve().ToProtoType())	
			if isinstance(geoelem, Line):	
				outlines.append(geoelem.ToProtoType())
OUT = outsurface, outedges, outlines

result without symbolic lines in Family (only masking regions)

result with symbolic lines

4 Likes

sorry poupin this is not working
the geometry is not the family instance geometry

showing the same values for all elements
anyway thanks

its not working alban