Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
hi all,
Is there any function to post the cl file using VB.NET
as a work around solution I have create the mapkey , this mapkey work fine within the CREO , but when running thru vb.net I get following error ' Illegal characters in input. Re-enter:"
vb.net code below..
mapkey1 = " mapkey pp @MAPKEY_LABELpostprocessor;~ Command `ProCmdMfgPostFile` ;\"
mapkey1 = mapkey1 & "mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\"
mapkey1 = mapkey1 & "mapkey(continued) ~ Update `file_open` `Inputname` `op010`;\"
mapkey1 = mapkey1 & "mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;#DONE;#UNCL01.P02;\"
mapkey1 = mapkey1 & "mapkey(continued) ~ Activate `texttool` `CloseButton`;"
mfg_session.RunMacro(mapkey1)
Solved! Go to Solution.
You are right. The culprit is the "\" character at the end of the lines.
Try:
mapkey1 = " ~ Command `ProCmdMfgPostFile` ;" mapkey1 = mapkey1 & "~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;" mapkey1 = mapkey1 & "~ Update `file_open` `Inputname` `op010`;" mapkey1 = mapkey1 & "~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;#DONE;#UNCL01.P02;" mapkey1 = mapkey1 & "~ Activate `texttool` `CloseButton`;"
According to VB API documentation:
The method pfcSession.BaseSession.RunMacro runs a macro string. A VB API macro string is equivalent to a Creo Parametric mapkey minus the key sequence and the mapkey name.
Based on this your mapkey1 string should look like this:
mapkey1 = " ~ Command `ProCmdMfgPostFile` ;\"
mapkey1 = mapkey1 & "~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\"
mapkey1 = mapkey1 & "~ Update `file_open` `Inputname` `op010`;\"
mapkey1 = mapkey1 & "~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;#DONE;#UNCL01.P02;\"
mapkey1 = mapkey1 & "~ Activate `texttool` `CloseButton`;"
hi,
I tried the code, I get the same error message
' Illegal characters in input. Re-enter:"
You are right. The culprit is the "\" character at the end of the lines.
Try:
mapkey1 = " ~ Command `ProCmdMfgPostFile` ;" mapkey1 = mapkey1 & "~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;" mapkey1 = mapkey1 & "~ Update `file_open` `Inputname` `op010`;" mapkey1 = mapkey1 & "~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;#DONE;#UNCL01.P02;" mapkey1 = mapkey1 & "~ Activate `texttool` `CloseButton`;"
Print the finished mapkey1 to a textbox, textfile or whatever and compare the string character by character to the original mapkey.
Probably just a missing character, additional whitespace or something of that nature..
hi all
Thanks for you support,
Now the code is working fine after removing the '"\"