<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Creo - Engr]]></title><description><![CDATA[Mechanical and Software Engineering]]></description><link>http://engr.io/</link><generator>Ghost 0.5</generator><lastBuildDate>Wed, 15 Apr 2026 11:17:31 GMT</lastBuildDate><atom:link href="http://engr.io/tag/creo/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Creo String to Integer or Real Number Relation]]></title><description><![CDATA[<p>I recently needed a method for converting a string parameter to an integer in Creo. So I created a script to generate a (rather long) relation to do the job. <br>
There is the <code>itos</code> function which performs the opposite, so treat this as a <code>stoi</code> function.</p>

<p><strong>Warning:</strong> This is a massive bodge, however i could not see any other method for doing it.</p>

<p>Instructions:</p>

<ul>
<li>Goto <a href="http://bl.ocks.org/veggielane/raw/449293ab850608d73a93/">http://bl.ocks.org/veggielane/raw/449293ab850608d73a93/</a></li>
<li>Change the String Length, String Param and Output Param.
<ul><li>The String Param is the Input parameter name.</li></ul></li>
<li>Copy all the relation text.</li>
<li>Paste it into the relations dialog in Creo.</li>
</ul>

<p>The source can be viewed: <a href="https://gist.github.com/veggielane/449293ab850608d73a93">https://gist.github.com/veggielane/449293ab850608d73a93</a></p>

<p>Caveats:</p>

<ul>
<li>Only works on a known length string.</li>
<li>Only works on whole numbers (but can output to a Real Number parameter).</li>
<li>To output to an Integer create the output parameter before adding the relation (it defaults to real).</li>
<li>For long strings the relation can get quite large, and i am unsure about the performance hit.</li>
</ul>]]></description><link>http://engr.io/creo-string-to-integer-relation/</link><guid isPermaLink="false">d8d5040f-28da-42bb-8c35-c6cf77352dbf</guid><category><![CDATA[Creo]]></category><category><![CDATA[Relation]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Tue, 13 Jan 2015 22:20:17 GMT</pubDate></item><item><title><![CDATA[PowerShell and Creo]]></title><description><![CDATA[<p>PowerShell can be used to talk to COM objects, here is a simple async connection example:</p>

<pre><code>PS C:\temp&gt; $async = New-Object -ComObject pfcls.pfcAsyncConnection
PS C:\temp&gt; $connection = $async.Connect($null,$null,$null,$null)
PS C:\temp&gt; $session = $connection.Session
PS C:\temp&gt; $session | Get-Member
PS C:\temp&gt; $session.CurrentModel.CommonName
</code></pre>

<p>And the output looks like this (a list of all the methods and properties on the session object):</p>

<p><img src="http://engr.io/content/images/2014/12/powershell.png" alt=""></p>

<p>These can then be accessed:</p>

<pre><code>PS C:\temp&gt; $session.CurrentModel.CommonName
prt0001.prt
</code></pre>

<p>This could be handy for automating repetitive tasks, it is quite powerful as it uses the COM object from the VB API. I will show more useful examples at a later date.</p>]]></description><link>http://engr.io/powershell-and-creo/</link><guid isPermaLink="false">ed9fda42-7fd8-4fd7-b340-2ffe84e00a75</guid><category><![CDATA[Creo]]></category><category><![CDATA[PowerShell]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Mon, 08 Dec 2014 20:11:06 GMT</pubDate></item><item><title><![CDATA[Creo APIs]]></title><description><![CDATA[<p>This is the start of information that I have gathered about the various <a href="http://http//creo.ptc.com/" title="Creo">Creo</a> APIs.</p>

<h2 id="visualbasicapi">Visual Basic API</h2>

<p>This may be called the Visual Basic API, however it can be accessed via any of the .net languages (and i belive anything with COM access), I will show examples in:</p>

<ul>
<li>C# .NET</li>
<li>Powershell</li>
</ul>

<p>Posts will be tagged with <a href="http://engr.io/tag/vb-api/" title="J-Link Pages">vb-api</a>.</p>

<h2 id="jlinkapi">J-Link API</h2>

<p>J-Link is the Java API for <a href="http://http//creo.ptc.com/" title="Creo">Creo</a>, it is the most powerful free API and has the ability to start when creo is loaded</p>

<p>Posts will be tagged with <a href="http://engr.io/tag/j-link/" title="J-Link Pages">j-link</a>.</p>

<h2 id="weblinkapi">Web.Link API</h2>

<p>This is the ActiveX component inside the embedded browser in <a href="http://http//creo.ptc.com/" title="Creo">Creo</a>. It can be access via JavaScript and therefore its supersets (e.g. CoffeeScript and TypeScript).</p>

<p>Posts will be tagged with <a href="http://engr.io/tag/web-link/" title="J-Link Pages">web-link</a>.</p>]]></description><link>http://engr.io/creo-apis/</link><guid isPermaLink="false">1b3b15ea-34aa-45cc-8724-1062112ab8ad</guid><category><![CDATA[Creo]]></category><category><![CDATA[MCAD]]></category><category><![CDATA[API]]></category><category><![CDATA[J-Link]]></category><category><![CDATA[VB-API]]></category><category><![CDATA[Web-Link]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Mon, 24 Nov 2014 20:27:40 GMT</pubDate></item><item><title><![CDATA[Creo J-Link Pane Launcher]]></title><description><![CDATA[<p>I have created a customisable J-Link that adds a pane (see screenshot) with an embedded web page inside it. The web page is fully compatable with the Web.Link API, so it can be used to create custom tools/infomation pages. <br>
<img src="http://engr.io/content/images/2014/11/screenshot.png" alt="Screenshot"></p>

<h3 id="compiling">Compiling</h3>

<p>If you want to compile the files they are available on <a href="https://github.com/veggielane/Engr.Creo.Jlink.LaunchPane" title="Engr.Creo.Jlink.LaunchPane">github</a>, and use Java SDK 6 described in <a href="http://engr.io/creo-j-link-compiling/" title="Creo J-Link Compiling">Creo J-Link Compiling</a></p>

<p>If you don't want to there is a released binary also available on <a href="https://github.com/veggielane/Engr.Creo.Jlink.LaunchPane/releases">github releases</a>.</p>

<h3 id="installation">Installation</h3>

<p>Copy the files into a folder, i am using <code>C:/temp/</code> for this example.</p>

<p>First change the <code>java_app_classpath</code> location in the protk.dat file to your directory.</p>

<pre><code>name     Engr.Creo.Jlink.LaunchPane
startup  java
java_app_class  LaunchPane
java_app_classpath C:/temp/LaunchPane/
java_app_start  start
java_app_stop   stop
allow_stop      true
delay_start     false
end
</code></pre>

<p>As per <a href="http://engr.io/creo-j-link-running-program/" title="Creo J-Link Running Program">Creo J-Link Running Program</a>, change the <code>protkdat</code> location to your folder, And revise the location of your java executable.</p>

<pre><code>jlink_java_command C:\Program Files\Java\jre7\bin\java.exe
protkdat C:/temp/LaunchPane/protk.dat
</code></pre>

<p>Finally update the <code>LaunchPane.properties</code> file with your desired locations.</p>

<pre><code>name=LaunchPane
icon=C:/temp/LaunchPane/icon.png
url=http://www.google.com
</code></pre>

<p>Then run your application as per <a href="http://engr.io/creo-j-link-running-program/" title="Creo J-Link Running Program">Creo J-Link Running Program</a></p>]]></description><link>http://engr.io/creo-j-link-pane-launcher/</link><guid isPermaLink="false">1086c0fe-e53e-4c62-9bb4-dced2399efb9</guid><category><![CDATA[Creo]]></category><category><![CDATA[J-Link]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Fri, 21 Nov 2014 18:21:29 GMT</pubDate></item><item><title><![CDATA[Creo J-Link Running Program]]></title><description><![CDATA[<p>It took me a while to decipher the user guide to get my first Hello World application working; it could be that i am not normally a Java programmer. <br>
However here is the process that I am happy with that runs a J-Link program, it uses the source from my <a href="https://github.com/veggielane/Engr.Creo.Jlink.LaunchPane" title="Engr.Creo.Jlink.LaunchPane">Engr.Creo.Jlink.LaunchPane</a> tool.</p>

<h3 id="configpro">config.pro</h3>

<p>These lines need to be added to your config pro:</p>

<pre><code>jlink_java_command C:\Program Files\Java\jre7\bin\java.exe
protkdat C:/temp/LaunchPane/protk.dat
</code></pre>

<p><code>jlink_java_command</code> points towards your JRE and doesn't use the internal Java shipped with Creo (which i couldn't get working); in this case I am using JRE 7. If Java's bin directory is in your system path, you can shorten this to <code>jlink_java_command java</code> <br>
<code>protkdat</code> points towards your application's <code>protkdat.dat</code> file.</p>

<h3 id="protkdat">protk.dat</h3>

<p>This file contains all the information creo needs to launch the program.</p>

<pre><code>name     Engr.Creo.Jlink.LaunchPane
startup  java
java_app_class  LaunchPane
java_app_classpath C:/temp/LaunchPane/
java_app_start  start
java_app_stop   stop
allow_stop      true
delay_start     false
end
</code></pre>

<p>The user guide details what each of these are, the important entry for me was the <code>java_app_classpath</code> this avoids needing to put this folder in the systems CLASSPATH.</p>

<h3 id="running">Running</h3>

<p>Creo should now load the J-Link program on startup, if you set <code>delay_start false</code> then its loaded but not started. You can then start it via the Auxiliary Applications menu.</p>]]></description><link>http://engr.io/creo-j-link-running-program/</link><guid isPermaLink="false">17949cc6-a77a-4bd3-b50a-f1318fb0a288</guid><category><![CDATA[Creo]]></category><category><![CDATA[J-Link]]></category><category><![CDATA[Java]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Fri, 21 Nov 2014 18:07:46 GMT</pubDate></item><item><title><![CDATA[Creo J-Link Compiling]]></title><description><![CDATA[<p>I am not a Java program but after a bit of trial and error I managed to get a J-Link application compiled, here are the details.  </p>

<h3 id="jdkversion">JDK Version</h3>

<p>Currently I have only managed to run programs compiled with JDK 6 available at the <a href="http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html" title="Java SE 6 Downloads">Java Archive Downloads</a>. However the programs do seem to run using JRE 7, see <a href="http://engr.io/creo-j-link-running-program/" title="Creo J-Link Running Program">Creo J-Link Running Program</a>, for details on how to run an application.</p>

<h3 id="commandline">Command Line</h3>

<p>I initially used the command line to compile the .java files. Here is the batch file that resided in source directory.</p>

<pre><code>"C:\Program Files\Java\jdk1.6.0_45\bin\javac" *.java -classpath "C:\Program Files\PTC\Creo 2.0\Common Files\M070\text\java\pfc.jar"
pause
</code></pre>

<p>I am using a 64bit machinem so am using the 64bit jdk, you will have to change the paths to <code>javac</code> and <code>pfc.jar</code> depending on your creo version.</p>

<h3 id="intellijideaandeclipseluna">IntelliJ IDEA and Eclipse Luna</h3>

<p>After having success with compiling with the command line, I decided to switch to an IDE; I managed to get programs compiling with <a href="https://www.jetbrains.com/idea/" title="IntelliJ IDEA IDE - JetBrains">IntelliJ IDEA</a> and <a href="https://eclipse.org/" title="Eclipse Luna">Eclipse Luna</a>. The important step is to ensure they were using JDK 6 for compiling. I ended up using IDEA, but the different was marginal.</p>]]></description><link>http://engr.io/creo-j-link-compiling/</link><guid isPermaLink="false">e8575ed6-31aa-4be5-8eaf-6505e075d02f</guid><category><![CDATA[Creo]]></category><category><![CDATA[J-Link]]></category><category><![CDATA[Java]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Fri, 21 Nov 2014 18:07:27 GMT</pubDate></item><item><title><![CDATA[Creo Solid Export Mapkeys]]></title><description><![CDATA[<p>This post details how to export solid files (parts and assemblies) using mapkeys. <br>
They all rely on the reset-loc mapkey shown in <a href="http://engr.io/creo-mapkeys/" title="Creo Mapkeys">Creo Mapkeys</a>, so this needs to be in your config file also. <br>
They also output to a specified folder <code>{DIRECTORY}</code>, this needs to be created before these are run.</p>

<h3 id="outputstepfilestp">Output STEP File (.stp)</h3>

<p>This saves a STEP (.stp) file with the filename of the original part to the specified directory:</p>

<script src="https://gist.github.com/veggielane/626058a7ce0c8c2b6fe2.js"></script>

<p>The directory has to be in the working directory. Note the calls to <code>reset-loc</code> before and after.</p>

<h3 id="outputigesfileigs">Output IGES File (.igs)</h3>

<script src="https://gist.github.com/veggielane/a200b763e513b76e4381.js"></script>

<h3 id="typeoptions">Type Options</h3>

<p>Here are the option types for each file type:</p>

<pre><code>Creo View (*.ed): db_1007
Creo View (*.edz): db_1011
Creo View (*.pvs): db_1101
Creo View (*.pvz): db_1102
IGES (*.igs): db_134
VDA (*.vda): db_136
DXF (*.dxf): db_137
Neutral (*.neu): db_198
STEP (*.stp): db_539
PATRAN (*.ntr): db_540
Cosmos (*.ntr): db_541
Stereolithography (*.stl): db_549
Inventor (*.iv): db_551
Wavefront (*.obj): db_552
Render (*.slp): db_553
SuperTab (*.unv): db_556
VRML (*.wrl): db_557
DWG (*.dwg): db_560
TIFF (*.tif): db_563
JPEG (*.jpg): db_566
ECAD IDF (*.emn): db_569
EDMD (*.idx): db_570
ECAD Lib IDF (*.emp): db_573
EPS (*.eps): db_582
TIFF (Snapshot) (*.tif): db_585
Optegra Vis (*.gbf): db_810
Medusa (*.asc): db_811
XPatch (*.facet): db_812
Shrinkwrap: db_813
ACIS File (*.sat): db_816
Parasolid (*.x_t): db_837
PDF (*.pdf): db_922
PDF U3D (*.pdf): db_923
U3D (*.u3d): db_924
Picture (*.pic): db_129
Zip (*.zip): db_9000
</code></pre>]]></description><link>http://engr.io/creo-solid-export-mapkey/</link><guid isPermaLink="false">41e2c707-e0bf-4886-a9c2-3fec2f289a54</guid><category><![CDATA[Creo]]></category><category><![CDATA[Mapkeys]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Sun, 16 Nov 2014 18:35:49 GMT</pubDate></item><item><title><![CDATA[Creo Mapkeys]]></title><description><![CDATA[<p>A Mapkey in Creo is another name for a macro. They contain one or more commands to be executed in the Creo session. They are executed using a sequence of characters typed into the session.</p>

<p>They are normally created in the 'Mapkeys' editor, which also saves them to config files.</p>

<h3 id="format">Format</h3>

<pre><code>mapkey {SEQUENCE} @MAPKEY_NAME{DESCRIPTION};@MAPKEY_LABEL{NAME};\
mapkey(continued) {CONTENT};
</code></pre>

<p>Where:</p>

<ul>
<li><code>{SEQUENCE}</code> is the character sequence. </li>
<li><code>{DESCRIPTION}</code> is description shown in the Mapkey Editor.</li>
<li><code>{DESCRIPTION}</code> is description shown in the Mapkey Editor.</li>
</ul>

<p>Note the mapkey spans multiple lines, using <code>\</code> to end a line and then <code>mapkey(continued) </code> on the next line.</p>

<h4 id="validcharacters">Valid Characters</h4>

<p>Here is a list of valid characters that can make up a makey sequence:</p>

<pre><code>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789?&gt;&lt;/.,":';|}{\][+_)(*&amp;^%$#@!~=-`
</code></pre>

<p>Alternatively the function keys (F1-F12) can be used by using the dollar sign e.g. <code>$F4</code></p>

<h2 id="examples">Examples</h2>

<p>These can be placed in creo config files (config.pro/sup), and will be loaded on start up.  </p>

<h3 id="callingcommandline">Calling Command Line</h3>

<p>The <code>@SYSTEM</code> macro can be used to run programs from the command line.</p>

<p>When <code>run</code> is typed, it runs a batch file located in the current working directory:</p>

<pre><code>mapkey run @MAPKEY_NAMEThis runs a bat file.;@MAPKEY_LABELRun Bat File;\
mapkey(continued) @SYSTEMbatfile.bat;
</code></pre>

<p>In order to run programs in other directorys it needs to be escaped:</p>

<pre><code>mapkey run @MAPKEY_NAMEThis runs a bat file.;@MAPKEY_LABELRun Bat File;\
mapkey(continued) @SYSTEMC:\\temp\\batfile.bat;
</code></pre>

<p>If there is a space in the path or filename it wont work (or at least i can't get it to). I have tried using brackets <code>"C:\Program Files\7-Zip\7z.exe"</code> but that doesn't work. A workaround I found is to use windows short paths, create a batch file called shortname.bat:</p>

<pre><code>@ECHO OFF
echo %~s1
</code></pre>

<p>Then call that with your long path:</p>

<pre><code>C:\&gt;shortname.bat "C:\Program Files\7-Zip\7z.exe"
C:\PROGRA~1\7-Zip\7z.exe
</code></pre>

<p>You can then use that in your mapkey (with escaped slashes):</p>

<pre><code>mapkey(continued) @MAPKEY_LABELPurge;\
mapkey(continued) @SYSTEMC:\\PROGRA~1\\7-Zip\\7z.exe;
</code></pre>

<p>If you want to chain command line programs, use a <code>&amp;</code> symbol between them (called left to right):</p>

<pre><code>mapkey(continued) @MAPKEY_LABELPurge;\
mapkey(continued) @SYSTEMC:\\PROGRA~1\\7-Zip\\7z.exe &amp; pause;
</code></pre>

<h3 id="callingpurge">Calling Purge</h3>

<p>If your system PATH contains the Creo bin path (which it should):</p>

<pre><code>mapkey purge @MAPKEY_NAMEThis purges the working directory.;@MAPKEY_LABELPurge;\
mapkey(continued) @SYSTEMpurge;
</code></pre>

<p>If however your PATH is not set correctlym use the short name (shown above) to the bin path:</p>

<pre><code>mapkey purge @MAPKEY_NAMEThis purges the working directory.;@MAPKEY_LABELPurge;\
mapkey(continued) @SYSTEMC:\\PROGRA~1\\PTC\\CREO2~1.0\\PARAME~1\\bin\\purge &amp; pause;
</code></pre>

<p>(This is for Creo 2.0, your installation may be different).</p>

<h3 id="resetdialoglocation">Reset Dialog Location</h3>

<p>Creo dialogs (open and save) annoying rememeber their last used location, this resets it back to the current working directory (useful for saving file mapkeys):</p>

<pre><code>mapkey reset-loc @MAPKEY_NAMEReset dialog location;@MAPKEY_LABELReset Location;\
mapkey(continued) ~ Command `ProCmdSessionChangeDir` ;\
mapkey(continued) ~ Close `file_open` `file_open`;
</code></pre>

<h3 id="callingothermapkeys">Calling Other Mapkeys</h3>

<p>You can call other Mapkeys using this syntax:</p>

<pre><code>%reset-loc;
</code></pre>

<p>This will call the reset-loc mapkey. I also use them to create aliases of other mapkeys for example:</p>

<pre><code>mapkey $f4 @MAPKEY_NAMEOutput;%zr;%laser;
</code></pre>

<p><a href="http://engr.io/tag/mapkeys/" title="Tagged Mapkeys">Click Here</a> for a list of all the mapkeys in this blog.</p>]]></description><link>http://engr.io/creo-mapkeys/</link><guid isPermaLink="false">58afb6c1-acda-4ac1-9394-6670692fa24d</guid><category><![CDATA[Creo]]></category><category><![CDATA[Mapkeys]]></category><dc:creator><![CDATA[veggielane]]></dc:creator><pubDate>Thu, 13 Nov 2014 21:18:56 GMT</pubDate></item></channel></rss>