Deconstruct leader

Hello,
not sure whether I’m missing something. Trying to process all text in a rhino file, mainly with objects from the Elefront plugin, which works well on almost anything but leaders. (returns )
Would anybody know to achieve this, or ist it just not implemented?

Quick update: it will work if the leader object is exploded within rhino first, separating the text from the arrow. Preferably this would be done in Grasshopper, yet there doesn’t seem to be an equivalent to the general ‘explode’ in grasshopper. Explode is more specific to the object type and none seems to work for leaders?

1 Like

Hello,

Is it not possible to deconstruct a leader with GH? I am using Elefront by Front and @AlanTai to reference in to GH, but it seems I can’t deconstruct to work with the text.

Thanks,

Dan

Hi,
I also needed to deconstruct a leader, so here’s a very simple Python script that works with the Elefront components.

Pts = leader.Points3D
Text = leader.Text
Plane = leader.Plane
Style = leader.GetDimensionStyle(leader.DimensionStyle)

I copied this into the Grasshopper Python Script Editor and couldn’t get it to work. Am I missing something? Thanks!

please provide a screenshot

It seems that the LeaderObject class was changed (I’m using Rhino7 and had the same problem).

I modified the code to:

Pts = leader.AnnotationGeometry.Points3D
Text = leader.DisplayText # leader.Text
Plane = leader.AnnotationGeometry.Plane
Style = leader.AnnotationGeometry.DimensionStyle
leader.Name = leader.DisplayText

To do this, I used the python built-in dir operator like: dir(leader) command to drill into the LeaderObject class and find the necessary attribute names (DisplayText, AnnotationGeometry.Plane, etc).

Took me a while to get this one done, particularly with spot elevations from LandFX into Rhino. But once you reference the object in GH (byLayer, using Elefront), you can treat it as a dimension - that way you can deconstruct it (also with Elefront). This gives you the baseplane and the text, which is what I needed to rebuild the spot elevations.