Extract origin point of annotation leaders

Hello,

Want to extract the coordinate of “plane origin” of bunch of leaders and drop a point there using python script.
element [3] of GetObjectsEx seems to give me a point on somewhere on the leader - and only seems to work on some of them - so not quite what i want…
Any help is apprciated - thanks!!!

Hi @yishida, you might try below script:

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

def leader_filter(rhino_object, geometry, component_index):
    if isinstance(rhino_object, Rhino.DocObjects.LeaderObject):
        return True
    return False

def DoSomething():
    msg = "Select leaders to extract tip points"
    ids = rs.GetObjects(msg, 512, True, True, custom_filter = leader_filter)
    if not ids: return
    
    for id in ids:
        rh_obj = rs.coercerhinoobject(id, True, True)
        leader_tip = rh_obj.Geometry.Plane.Origin
        rs.AddPoint(leader_tip)
    
DoSomething()

_
c.

great… thanks!!