CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > Annotation

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 12-04-2018, 07:16 AM
andrea andrea is offline
Registered User
 
Join Date: Sep 2003
Location: italy
Posts: 247
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?
Reply With Quote
  #2  
Old 12-04-2018, 11:54 PM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 212
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\")
Anche se mi lascia perplesso che fai la selezione su un punto
E' una info da aggiungere per la compilazione del cartiglio?
Reply With Quote
  #3  
Old 12-06-2018, 08:31 AM
andrea andrea is offline
Registered User
 
Join Date: Sep 2003
Location: italy
Posts: 247
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.
Reply With Quote
  #4  
Old 12-06-2018, 02:21 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 262
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 v15-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #5  
Old 12-07-2018, 12:37 AM
andrea andrea is offline
Registered User
 
Join Date: Sep 2003
Location: italy
Posts: 247
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" !!
Reply With Quote
  #6  
Old 12-07-2018, 04:37 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 262
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"))
Note that you will need to have myobj specified in your dialog, where myobj is an Annotation object.

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 v15-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #7  
Old 12-10-2018, 06:48 AM
andrea andrea is offline
Registered User
 
Join Date: Sep 2003
Location: italy
Posts: 247
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))))))
Reply With Quote
  #8  
Old Yesterday, 09:27 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 262
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 v15-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:41 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.