Get lines and arcs of doors

Hi everyone,
I would like to get the arcs and lines of the set doors in my viewport to produce custom fillings for these.
I know that this could be handled by setting these fillings up in the door families, but I would like to get this as an additive process.
Does anyone know how to extract these from a door element? I get it to unwrap with “door = UnwrapElement(IN[0])”, but I don´t know how to extract the lines and arcs now.

Thanks for helping me on this one :slight_smile:
Kind regards,
Jannis

Hmmm… Good question :slight_smile:

Get element geometry doesn’t work, it only gives a solid.

I don’t believe there is a node for this…

There is a Class for SymbolicCurve
http://www.revitapidocs.com/2018/c6c3bde4-4aa9-1b08-cd71-2fad0613d276.htm

We can get Geometry and GeometryCurve from there, but I’m not sure how to drill down from a Family Type in the API to get it, @kennyb6 is a master at this kind of thing :slight_smile:

Apologies,

Mark

Lol thanks for the shout out but I am not that good with this stuff and even less so when it comes to families. I can get the individual solids within a family but can’t find the symbolic lines from a plan view. Hopefully someone much more experienced with families and their docs like @erfajo can help out.

I did find this but couldn’t get it to work for me: https://thebuildingcoder.typepad.com/blog/2011/08/retrieving-lines-within-a-family-instance.html

1 Like

Sorry Kenny, or maybe @Kulkul is around? :smiley:

1 Like

I think that element geometry sometimes works, depending on how the doors are built (not here to debate merit of one method or the other, just to talk Dynamo). Any chance you could upload a file with a door illustrating how your library is built @Jannis?

Model lines get returned, but not symbolic…

1 Like

Hi @Jannis,

Yes it is possible.
You will have to translate the geometry from the internal origin of the project to the position of the instance.
Thanks for the link @kennyb6 !

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

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

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

doc = DocumentManager.Instance.CurrentDBDocument

items = UnwrapElement(IN[0])
if not hasattr(items, '__iter__'):
	items = [items]

lineList,arcList=[],[]

opt = Options()
opt.IncludeNonVisibleObjects = False
opt.View = doc.ActiveView
for item in items:
	geoEle=item.get_Geometry(opt)
	for geoInstance in geoEle:
		allLines,allArcs=[],[]
		for symbIns in geoInstance.SymbolGeometry:
			if isinstance(symbIns, Line):
				lines = symbIns
				allLines.append(lines.ToProtoType())	
			if isinstance(symbIns, Arc):
				arcs = symbIns
				allArcs.append(arcs.ToProtoType())
		lineList.append(allLines)
		arcList.append(allArcs)

OUT=lineList,arcList 


EDIT : Added the Geometry.Transform

6 Likes

Awesome Alban,

Do you have a link to find out more about the IsInstance?

My example door had a masking region rather than lines to show the door panel and I would like a list of things which I can search for…!

Hope that makes sense,

Mark

Here is a link with the isinstance() function :
https://www.programiz.com/python-programming/methods/built-in/isinstance

if you delete the check ( isinstance), you get the list of all the symbol geometries.

Surprisingly, the masking region appears as a solid and can’t be convert in Dynamo geometry.

1 Like

I got a bounding box from it, but it’s quite big…!

image

image

:smiley:

Wow, this works just perfect. Thank you so much :slight_smile: That´s really exactly what I needed.

Hi Jannis,

I made a custom node : FamilyInstance Symbolic Lines with a better script in the Genius Loci package.
It will be more convenient :slightly_smiling_face:

FamilyInstance%20Symbolic%20Lines

5 Likes

Thanks again Alban, this is just working perfectly :slight_smile:

thanks alban for your grate work :slight_smile:

1 Like

Hi Alban,

This node seems not working with family instances get from linked docs. Are there any hints?

Hi @Hoo,

I corrected the cutom node on Github.
(Right click and Save As on the Raw button.)
Replace the old node in C:\Users\%USERNAME%\AppData\Roaming\Dynamo\Dynamo Revit\2.13\packages\Genius Loci\dyf

1 Like

Thanks for your great help Alban,

Furthermore, we found that node “FamilyInstance Symbolic Lines” not working very smooth with family instances at different views / levels.

Indeed the custom node uses the active view to obtain the geometry. A input view could be added though.

2 Likes