cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Custom Symbol Question

Prasad_G
12-Amethyst

Custom Symbol Question

Hi,

 

I was wondering if we can design a custom symbol in CREO where instead of typing variable text in dialog box, we can directly type the variable text in Annotation note itself:

 

For example:

On typing "&sym(TRIANGLE_1) THIS IS A TEST NOTE" I should get following result : 

 

Prasad_G_0-1663054917085.png

 

And on typing "&sym(TRIANGLE_2) THIS IS A TEST NOTE" I should get following result : 

 

Prasad_G_1-1663054987409.png

 

AND HENCE FORTH....

 

I have seen similar capabilities in other design softwares, was wondering if similar approach exists in CREO.

 

Please let me know if this can be done, since I am working on an automation tool.

 

Any coding based approach are also welcomed, since I have some knowledge on vbapi libraries of CREO. 

 

Thanks and Regards,

Prasad

 

ACCEPTED SOLUTION

Accepted Solutions
Prasad_G
12-Amethyst
(To:FV)

Thanks a lot for your response.

 

You were right, vbapi does not have the necessary api call to do this.

 

As a substitute what I did was

1) Evaluate the exact location where the symbol needs to be added, and add it

2) Relate the flag note symbol to the note (so that symbol moves along with notes)

 

Having the symbol syntax is the best way to go. But this is a substitute for those who are using vbapi.

View solution in original post

4 REPLIES 4

1. You can use API to write any text in variable text of the symbol instance. Take a look "Symbol Instance Variable Text" in documentation.

 

2. The syntax "&sym(TRIANGLE_1) THIS IS A TEST NOTE" place symbol instance TRIANGLE_1 in note before  text "THIS IS A TEST NOTE". Looks like what you are asking. Why this is not suitable for you?

Hi @YaroslavSin ,

 

Thanks a lot for reply.

 

To put it in simple terms I wanted to know if I can replace some text in Annotation note with some symbol having variable text. 

 

For Ex: If there is an annotation note saying  "THIS IS A TESTSYMBOL"

Prasad_G_0-1663763601499.png

 

I want to replace the text TESTSYMBOL with a symbol 

 

Prasad_G_1-1663763874102.png

 

Doing this manually would involve me replacing the text "TESTSYMBOL" with &sym($symbolName$) and then entering the variable text "1" in dialog.

 

I want to achieve this through code.

 

PS: I already know how to place a symbol in a location by cood or letting the user to select point. My issue is how to replace some text in annotation note with symbol having variable text.

 

 

FV
17-Peridot
17-Peridot
(To:Prasad_G)

just an idea.

for your use-case you have to encode variable text name and value in your input string and to write some code for the conversion of your encoded input into the valid note text and the custom action to be performed later after an annotation feature is regenerated with the intended symbol.

something like this:

start with text '&sym( $symbolName${$variable_text_name$:$variable_text_value$}) SOME NOTE TEXT' - symbol name followed by plain JSON encoding.

extract &sym($symbolName$) string and {$variable_text_name$:$variable_text_value$} and the actual note text.

process the note with the first extracted part and note-text.

process symbol's variable text with the second extracted part.

 

I don't know if vbapi could handle it but I'm pretty sure Pro/Toolkit (or OTK) has the necessary API calls.

HIH. 

 

 


@Prasad_G wrote:

Hi @YaroslavSin ,

 

Thanks a lot for reply.

 

To put it in simple terms I wanted to know if I can replace some text in Annotation note with some symbol having variable text. 

 

For Ex: If there is an annotation note saying  "THIS IS A TESTSYMBOL"

Prasad_G_0-1663763601499.png

 

I want to replace the text TESTSYMBOL with a symbol 

 

Prasad_G_1-1663763874102.png

 

Doing this manually would involve me replacing the text "TESTSYMBOL" with &sym($symbolName$) and then entering the variable text "1" in dialog.

 

I want to achieve this through code.

 

PS: I already know how to place a symbol in a location by cood or letting the user to select point. My issue is how to replace some text in annotation note with symbol having variable text.

 

 


 

Prasad_G
12-Amethyst
(To:FV)

Thanks a lot for your response.

 

You were right, vbapi does not have the necessary api call to do this.

 

As a substitute what I did was

1) Evaluate the exact location where the symbol needs to be added, and add it

2) Relate the flag note symbol to the note (so that symbol moves along with notes)

 

Having the symbol syntax is the best way to go. But this is a substitute for those who are using vbapi.

Announcements


Top Tags