<?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[Mapkeys - Engr]]></title><description><![CDATA[Mechanical and Software Engineering]]></description><link>http://engr.io/</link><generator>Ghost 0.5</generator><lastBuildDate>Mon, 20 Apr 2026 02:03:56 GMT</lastBuildDate><atom:link href="http://engr.io/tag/mapkeys/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><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>