Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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 :
And on typing "&sym(TRIANGLE_2) THIS IS A TEST NOTE" I should get following result :
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
Solved! Go to Solution.
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.
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"
I want to replace the text TESTSYMBOL with a symbol
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.
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"
I want to replace the text TESTSYMBOL with a symbol
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.
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.