Post CL file using VB.NET
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Post CL file using VB.NET
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)
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Solved! Go to Solution.
- Labels:
-
General
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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`;"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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`;"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi,
I tried the code, I get the same error message
' Illegal characters in input. Re-enter:"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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`;"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi all
Thanks for you support,
Now the code is working fine after removing the '"\"
