It’s probably stupidly simple but i cant figure out how to get the the displayed element id of the selected egde
maybe someone can point me in the right direction, thanks
It’s probably stupidly simple but i cant figure out how to get the the displayed element id of the selected egde
maybe someone can point me in the right direction, thanks
OOTB, I am not sure how to do that. But using springnodes
, we can add an additional output to his node.
#Copyright(c) 2016, Dimitar Venkov
# @5devene, dimitar.ven@gmail.com
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
sel1 = uidoc.Selection
ot1 = Selection.ObjectType.Edge
refs = sel1.PickObjects(ot1, "Select the desired edges and press Finish")
edges = []
for i in xrange(len(refs)):
el1 = doc.GetElement(refs[i].ElementId)
edge = el1.GetGeometryObjectFromReference(refs[i])
edges.append(edge.AsCurve().ToProtoType())
OUT = edges,el1
Thanks, worked perfectly
@john_pierson Perfect.
How can I return the edge as Edge and no as Curve?
Change this from
edge.AsCurve().ToProtoType()
to
edge.ToDSType()
Yea i thought about it but a iget an error.
k, do this instead.
Change this from
edge.AsCurve().ToProtoType()
to
edge
beyond that, open a new topic and try to explain what you are wanting to do with edges.
Thnaks . i open new topic