Check for overlapping leaders

Using RhinoCommon how can I check if the text of two leaders is overlapping?
In specific, how can I get the bounding box of just its text (excluding the arrow)?

I did not find the Text geometry on DocObjects.LeaderObject

Hi @Goswin,

You might try comparing the planes and/or bounding boxes for overlap.

Use LeaderObject.GetSubObjects to get the text component for bounding box comparison.

– Dale

Thanks @dale,
is this a bug ?
leaderObject.GetSubObjects() returns an empty array.

Here is a script to test this:

import rhinoscriptsyntax as rs

guid = rs.GetObject()
leaderObject = rs.coercerhinoobject(guid)
print leaderObject.DisplayText # to verify object
print leaderObject.GetSubObjects() # empty array

@dale It seems the only solution is to draw the leader to the document, explode it via macro, find text object, get boundingbox, and then delete the text and created lines.
Or would you suggest another workflow to get the texts bounding box?

1 Like

Hi @Goswin,

Without an “explode”-like function, this might be the best you can do.

– Dale