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
hi guys
i’m trying to retrieve the geometry of a family element which has only one detail element
the result is
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:
Hi Jacob
I tried this already and checked once again but the result is same
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.
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:
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.
Hope this works Thanks Jacob
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.
It’s classified as furniture in this case.
Jacob is Right but your reply help to understand more clearly thanks Alban
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.
EDIT :
Looks like I was too quick in my tests. See the post by @c.poupin below.
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
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