Thread: Add elemt info
View Single Post
  #8  
Old 12-11-2018, 08:27 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: Add elemt info

Thanks for the additional information. I was thinking you needed to pick the object using the mouse -- since you can get the x and y points from the functions you listed, something like this might work:

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))))))
    (setf pnt-y (gpnt2d_y (Nth 0 (sd-am-sheet-struct-corners (sd-am-inq-sheet (sd-am-inq-curr-sheet))))))
    (setf cmdstr (format nil "ADD_ELEM_INFO 'TR:WTtr:PTC_WM_LIFECYCLE_STATE:2:0:1:-102:1:0' select global texts (pnt_xy ~a ~a) confirm end" pnt-x pnt-y))
    (sd-execute-annotator-command :cmd cmdstr)
    )
  )
Then just call the add-infos-to-sheet function and it should work. NOTE: I haven't tested this, but the idea is correct.

Does this help?
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote