#1
|
|||
|
|||
Add elemt info
it is possible to associate an annotation info to a text.
With me10 the command was used. ADD_ELEM_INFO 'TR:WTtr:PTC_WM_LIFECYCLE_STATE:2:0:1:-102:1:0' SELECT GLOBAL PICK_VP_PNT 1 -50,10 CONFIRM END Is it possible to do it directly in annotation? |
#2
|
||||
|
||||
Re: Add elemt info
Prova questo
Code:
(OLI:SD-EXECUTE-ANNOTATOR-COMMAND :CMD \"ADD_ELEM_INFO 'TR:WTtr:PTC_WM_LIFECYCLE_STATE:2:0:1:-102:1:0' SELECT GLOBAL PICK_VP_PNT 1 -50,10 CONFIRM END\") E' una info da aggiungere per la compilazione del cartiglio? |
#3
|
|||
|
|||
Re: Add elemt info
sure that the "\" go there? gives me lisp error
in place of the coordinates "PICK_VP_PNT 1 -50,10" can I enter a variable that I calculate ?? there is an info to associate with a text already present on the cartouche completed by hand Last edited by andrea; 12-06-2018 at 08:55 AM. |
#4
|
|||
|
|||
Re: Add elemt info
You are correct that the "\" causes errors in this case -- no "\" is needed.
You can certainly do this using the "ADD_ELEM_INFO ..." command, but (as you have discovered), it can be difficult to specify the object that you want to attach the info to. Perhaps an easier way for you to do it is to use the lisp functions provided by the Annotation module. This will allow your dialog to allow the user to select an annotation item (part, line, etc) and then add the INFO to it using the command (sd-am-add-info-attributes (list "Info 1" "Info 2" ) myobject) or something like that. This would allow you to easily construct the info strings within your dialog and then attach them to the selected object. Of course, if you want to use the ADD_ELEM_INFO approach, you can create that entire string using the (format ... ) command to build the string with the components you'd like, and then send that string to Annotation using the (sd-execute-annotator-command :cmd mystring) approach... I hope this helps! andy
__________________
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! |
#5
|
|||
|
|||
Re: Add elemt info
what is the right writing to insert in :
(list "Info 1" "Info 2") for my attribute PTC_WM_LIFECYCLE_STATE that I can not find the documentation for command : sd-am-add-info-attributes andl list "Info" !! |
#6
|
|||
|
|||
Re: Add elemt info
You could do something like this:
Code:
(sd-am-add-info-attributes myobj (list "TR:WTtr:PTC_WM_LIFECYCLE_STATE:2:0:1:-102:1:0")) The documentation for sd-am-add-info-attributes (and other related functions) can be found in the help. Select "Documentation for Advanced Users" Select "Integration Kit" Select "Reference Manual" Scroll down and select "Info Attributes" (under the Annotation Module heading) Read about the functions and how they work. I hope this helps! andy
__________________
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! |
#7
|
|||
|
|||
Re: Add elemt info
to indicate a "myobj" the text to which I want to add the info via the coordinates 2d ??
my text here I want to add the info has these 2D coordinates (always different from one drawing to another): (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)))))) |
#8
|
|||
|
|||
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) ) ) 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! |
#9
|
|||
|
|||
Re: Add elemt info
Don't add info at this text ....
why ??? |
#10
|
||||
|
||||
Re: Add elemt info
Figure out!
try this Code:
(setf cmdstr (format nil "LINE (pnt_xy ~a ~a)" pnt-x pnt-y)) Does the Annotator exe report an error? call (oli:sd-am-errros :clear) before your function call call (display (oli:sd-am-errros :get_all)) after your function call
__________________
|
#11
|
|||
|
|||
Re: Add elemt info
help me, this is the example to which I want to add my info to the text indicated in the image
This is the macro that I created, but does not add the info to the text (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.964)) (setf pnt-y (+ (gpnt2d_y (Nth 0 (sd-am-sheet-struct-corners (sd-am-inq-sheet (sd-am-inq-curr-sheet))))) 22.792)) (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)) (oli:sd-execute-annotator-command :cmd cmdstr) ;;(DISPLAY(format nil "~a ~a" pnt-x pnt-y)) ) ) |
#12
|
|||
|
|||
Re: Add elemt info
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) ) )
__________________
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! |
#13
|
|||
|
|||
Re: Add elemt info
Perfect thank you very much
|
#14
|
|||
|
|||
Re: Add elemt info
You are very welcome! Glad to 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! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|