Hi Andrea,
Thanks for including the drawing file and the image of the text you want to use -- both were very helpful!
It turns out that selecting texts using the SELECT method using a point (as we did) doesn't work, so we need to do something else.
It does work to pick the point directly, but it needs to be exact. I modified the function so it uses slightly different coordinates (both x and y) and use that point directly:
Code:
(defun add_infos_to_sheet_text ()
(let (pnt-x pnt-y cmdstr)
(setf pnt-x (- (gpnt2d_x (Nth 1 (sd-am-sheet-struct-corners (sd-am-inq-sheet (sd-am-inq-curr-sheet))))) 125.963))
(setf pnt-y (+ (gpnt2d_y (Nth 0 (sd-am-sheet-struct-corners (sd-am-inq-sheet (sd-am-inq-curr-sheet))))) 22.7918))
(setf cmdstr (format nil "ADD_ELEM_INFO 'TR:WTtr:PTC_WM_LIFECYCLE_STATE:2:0:1:-102:1:0' global (pnt_xy ~a ~a) end" pnt-x pnt-y))
(pprint (format nil "cmdstr: ~A" cmdstr))
(oli:sd-execute-annotator-command :cmd cmdstr)
)
)
Please let me know how this works for you.