Data shapes select edges and revit edges

Hi, I’m getting different lines returned between data shape select edges and Revit. Is there a way to incorporate revit select edges into data shapes so I can use it with dynamo player? Possibly another input into the python to add revit select curves? Or is there a different class or something I can call?

#Copyright (c) mostafa el ayoubi ,  2016
#Data-Shapes ,

class uiselectedges():

    def __init__(self,inputname,buttontext):
        self.inputname = inputname
        self.buttontext = buttontext

    def __repr__(self):
        return 'UI.SelectEdges input'
x = uiselectedges(IN[0],IN[1])

OUT = x
	    def pickedges(self, sender, event):
			edges = []
			for c in self.Controls:
				c.Enabled = False	
				seledge = uidoc.Selection.PickObjects(Selection.ObjectType.Edge,'')
				for s in seledge:
					e = uidoc.Document.GetElement(s).GetGeometryObjectFromReference(s).AsCurve().ToProtoType(True)
					e.Tags.AddTag("RevitFaceReference", s)
				sender.Tag = edges
			for c in self.Controls:
				c.Enabled = True

Topo_Align Edges.dyn (91.9 KB)

Can you post a simple RVT data set to reproduce, and a preview showing the discrepancy you are seeing?

I tried to reproduce it but it just seemed to work this time… Can we delete this post? :expressionless: Or if it ever pops up again I’ll post

Let’s leave it be so we can resume if needed… My guess is it has something to do with unit conversion in 2022, or a link instance incorrectly reporting the info.

1 Like

@jacob.small, @Mostafa_El_Ayoubi

I’m experiencing a related issue with the Data-Shapes Edge Selection tool where it seems to be reporting the family instance’s origin point and not the in-project origin / coordinates.

Refer to the screenshots below;

SampleFamily.rfa (632 KB)

If it is an error in the code then there is likely nothing I can do as I am not the owner of the datashapes package, but I’ll see if I can reproduce or find an easy fix if you start a new topic with the dataset and code to reproduce. Be sure you’re on a fully updated Revit and datashapes package version first though.

Thanks for reporting this @stefan.oberholzer .
I’ll see what I can do and update this thread.

1 Like


Thanks for the quick reply! For now, as a workaround, I’m doing a translation based on the family instance’s location and the edge curve.

@Mostafa_El_Ayoubi , thanks, you’re a legend!


I had a feeling I had already heard of this issue… It turns out that not only has it already been reported, someone by the name of Deniz Maral had even offered a fix (@Deniz_Maral I believe it’s you? :slight_smile: ) !
I have not been able to merge the pull request because the package is not well maintained on github (I should fix that) and that’s why it didn’t make it to the version that’s in the package manager, but I’ve just implemented their code for surfaces and applied it to edges as well and pushed it. So thanks @Deniz_Maral haha :smiley:

v.2023.2.107 just published to the package manager.


@Mostafa_El_Ayoubi ,

THANK YOU VERY MUCH!!! Problem sorted, if I ever see you in person, lunch is on me!!



Yeah, it was me :slight_smile:

1 Like