
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Razorleaf Corporation &#187; Developer&#8217;s Corner | Razorleaf Corporation</title>
	<atom:link href="http://www.razorleaf.com/category/newsletter/developers-corner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.razorleaf.com</link>
	<description>Innovative Process Solutions. Bottom-Line Results.</description>
	<lastBuildDate>Mon, 23 Jan 2012 19:09:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Custom Context Menu Entries in Windows 7</title>
		<link>http://www.razorleaf.com/2010/10/custom-context-menu/</link>
		<comments>http://www.razorleaf.com/2010/10/custom-context-menu/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 19:00:26 +0000</pubDate>
		<dc:creator>Kevin Carpenter</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[Platform Technologies]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[tips+tricks]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Registry]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=8429</guid>
		<description><![CDATA[As developers, we’re known to tweak things to get them just exactly like we want them.  So here’s a quick tip on getting your own menu  <a href="http://www.razorleaf.com/2010/10/custom-context-menu/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/10/custom-context-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autocomplete and IntelliSense</title>
		<link>http://www.razorleaf.com/2010/08/autocomplete-and-intellisense/</link>
		<comments>http://www.razorleaf.com/2010/08/autocomplete-and-intellisense/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 14:39:45 +0000</pubDate>
		<dc:creator>Jonathan Scott</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[BasicScript]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=8183</guid>
		<description><![CDATA[<p><img width="236" height="127" src="http://www.razorleaf.com/wp-content/uploads/2010/08/AutoHotkey-Logo.gif" class="attachment-post-thumbnail wp-post-image" alt="AutoHotkey Logo" title="AutoHotkey Logo" /></p><img class="alignleft size-full wp-image-8184" title="Intellisense Picture" src="http://www.razorleaf.com/wp-content/uploads/2010/08/Intellisense-Picture.png" alt="" width="112" height="65" />If you’ve been developing programs for a while, you probably either love autocompletion features or you hate them.  If you’re in the former camp, or you’re just getting started with programming, this tip is just for you.  Autocomplete, or the Microsoft equivalent, <a href="http://en.wikipedia.org/wiki/IntelliSense">IntelliSense</a>, is a feature within certain software that tries to automatically complete what you’ve started typing before you finish typing all of the letters yourself.  For a lot of people, this is a<strong> real time-saver</strong> and can prevent typographical mistakes.  But what if you’re working on code in a text file, or in a development environment that doesn’t have autocomplete?  Here are a few utilities that can help you out.  <span id="more-8183"></span>
<h3><img class="alignright size-full wp-image-8185" title="PhraseExpress Logo" src="http://www.razorleaf.com/wp-content/uploads/2010/08/PhraseExpress-Logo.png" alt="" width="190" height="27" />PhraseExpress</h3>
A freeware utility (with a commercial cousin), <a href="http://www.phraseexpress.com/">PhraseExpress</a> offers autotext (text substitution), autocomplete (finishing what you start to type), spell checking, and a program launcher (from text shortcuts).  The interface is polished, and options for the various autocompletions appear in contextual menus.  The tool includes some advanced features, too, like the ability to include formatting and images in the inserted text (more useful for email signatures and the like than for coding applications).
<h3>Texter</h3>
<img class="alignright size-full wp-image-8188" title="Lifehacker Texter Screenshot" src="http://www.razorleaf.com/wp-content/uploads/2010/08/Lifehacker-Texter-Screenshot.png" alt="" width="274" height="121" />If you haven’t browsed through the <a href="http://lifehacker.com/">Lifehacker website</a>, checking out the <a href="http://lifehacker.com/238306/lifehacker-code-texter-windows">Texter</a> tool might be your introduction to a new resource.  The folks over at Lifehacker offer a number of time-saving tips, and they actually wrote Texter.  This open source Windows application runs in the system tray as a universal text substitution tool, meaning it works in any Microsoft Windows application.  You can start with basic things like replacing text using a <strong>hotstring</strong>.  For example, when I type “newSTUtil” and then the TAB key, Texter will replace “newST” with “Set SmUtil = SmSession.GetService("SmUtil.SmSessionUtil")”  You can see how this would be handy for enhancing simple coding tools like BasicScript, the development utility that is included with ENOVIA SmarTeam.
<h3><img class="alignright size-full wp-image-8189" title="TypingAid Logo" src="http://www.razorleaf.com/wp-content/uploads/2010/08/TypingAid-Logo.png" alt="" width="107" height="91" />TypingAid</h3>
Another very basic tool, <a href="http://www.artwinauto.com/software/downloads/typingaid.html">TypingAid</a> requires you to setup a text substitution list (wordlist.txt) to use as its “guide”.  Based on the content of this file, the executable watches what you type and suggests possible matches from your wordlist.txt file.  You simply choose the number of the entry that you want to use, and your text is automatically completed.  It’s very simple, but very effective.  TypingAid is also available as open source software.
<h3><img class="alignright size-full wp-image-8190" title="AutoHotkey Logo" src="http://www.razorleaf.com/wp-content/uploads/2010/08/AutoHotkey-Logo.gif" alt="" width="191" height="103" />AutoHotKey</h3>
<a href="http://www.autohotkey.com/">AutoHotKey</a> (AHK) is the granddaddy of all Microsoft Windows-based autocomplete utilities.  In fact, Texter and TypingAid (mentioned above) are both written in <strong>AutoHotKey’s scripting language</strong>.  AHK is useful for a lot more than text substitution and autocompletion, though – you can automate any series of keystrokes or mouse clicks by hand or through the use of AHK’s macro recorder.  What’s more, you can compile your AutoHotKey macros into their own executables that can be run on other computers that don’t have AutoHotKey installed.

<img class="alignleft size-medium wp-image-5162" title="Free Sign" src="http://www.razorleaf.com/wp-content/uploads/2009/10/Free-Sign-250x199.jpg" alt="" width="122" height="96" />So there you have it, <strong>IntelliSense everywhere</strong> (in Microsoft Windows at least), and for free too.  What are your favorite productivity enhancing tools for programming?  Leave us a comment below and share your tips and tricks.]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/08/autocomplete-and-intellisense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>32-bit and 64-bit ASP.NET</title>
		<link>http://www.razorleaf.com/2010/07/32-64-asp-net/</link>
		<comments>http://www.razorleaf.com/2010/07/32-64-asp-net/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 02:54:14 +0000</pubDate>
		<dc:creator>Paul Luc</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[Platform Technologies]]></category>
		<category><![CDATA[32-bit]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Microsoft Windows Server]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[Windows on Windows 64]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=7915</guid>
		<description><![CDATA[Many developers struggle with the use of 32-bit and 64-bit address spaces.  In a nutshell, 32-bit assemblies cannot be loaded within 64-bit address spaces and 64-bit  <a href="http://www.razorleaf.com/2010/07/32-64-asp-net/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/07/32-64-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio Item Templates</title>
		<link>http://www.razorleaf.com/2010/05/visual-studio-item-templates/</link>
		<comments>http://www.razorleaf.com/2010/05/visual-studio-item-templates/#comments</comments>
		<pubDate>Fri, 28 May 2010 21:00:12 +0000</pubDate>
		<dc:creator>Paul Luc</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Item Template]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2005]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=5955</guid>
		<description><![CDATA[The Visual Studio Integrated Design Environment (IDE) is highly customizable and can be extended.  In fact, it’s possible to automate repetitive and tedious item creation tasks  <a href="http://www.razorleaf.com/2010/05/visual-studio-item-templates/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/05/visual-studio-item-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with Timezones in a Global Environment</title>
		<link>http://www.razorleaf.com/2010/04/timezones-in-global-plm/</link>
		<comments>http://www.razorleaf.com/2010/04/timezones-in-global-plm/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 03:58:14 +0000</pubDate>
		<dc:creator>Steve Dunn</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[ENOVIA SmarTeam]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[global environment]]></category>
		<category><![CDATA[GMT]]></category>
		<category><![CDATA[SmarTeam ServerMode]]></category>
		<category><![CDATA[timezone]]></category>
		<category><![CDATA[UTC]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=7325</guid>
		<description><![CDATA[Global collaboration can be tricky for a number of reasons.  For instance, when developing an application that is shared between users in two or more time  <a href="http://www.razorleaf.com/2010/04/timezones-in-global-plm/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/04/timezones-in-global-plm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SolidWorks Event Wrappers</title>
		<link>http://www.razorleaf.com/2010/04/solidworks-api-event-wrapper/</link>
		<comments>http://www.razorleaf.com/2010/04/solidworks-api-event-wrapper/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 11:00:44 +0000</pubDate>
		<dc:creator>Paul Luc</dc:creator>
				<category><![CDATA[Computer Aided Design]]></category>
		<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[event handling]]></category>
		<category><![CDATA[Event Subscription]]></category>
		<category><![CDATA[SolidWorks API]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=7266</guid>
		<description><![CDATA[The SolidWorks API (Application Programming Interface) is immensely powerful.  In fact, if something is doable within SolidWorks, the chances are good that there is a corresponding  <a href="http://www.razorleaf.com/2010/04/solidworks-api-event-wrapper/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/04/solidworks-api-event-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reasons to Develop using VMs</title>
		<link>http://www.razorleaf.com/2010/03/reasons-to-develop-using-vms/</link>
		<comments>http://www.razorleaf.com/2010/03/reasons-to-develop-using-vms/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 22:00:28 +0000</pubDate>
		<dc:creator>Steve Dunn</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[development environment]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[VMs]]></category>
		<category><![CDATA[VMWare Workstation]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=7189</guid>
		<description><![CDATA[When planning any software development project, whether it is a point or enterprise solution, there are several key questions to answer before a line of code  <a href="http://www.razorleaf.com/2010/03/reasons-to-develop-using-vms/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/03/reasons-to-develop-using-vms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating Transfer of SmarTeam Vault Data</title>
		<link>http://www.razorleaf.com/2010/02/smarteam-vault-data-xfer/</link>
		<comments>http://www.razorleaf.com/2010/02/smarteam-vault-data-xfer/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 18:00:59 +0000</pubDate>
		<dc:creator>Steve Dunn</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[ENOVIA SmarTeam]]></category>
		<category><![CDATA[Product Data Management]]></category>
		<category><![CDATA[Product Lifecycle Management]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[BasicScript]]></category>
		<category><![CDATA[file transfer]]></category>
		<category><![CDATA[rendition management]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SmarTeam]]></category>
		<category><![CDATA[SmarTeam Vault Server]]></category>
		<category><![CDATA[test environment]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=6657</guid>
		<description><![CDATA[<p><img width="134" height="67" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-Files-Successfully-Copied-Thumbnail.png" class="attachment-post-thumbnail wp-post-image" alt="SmarTeam CopyFilesToTest Files Successfully Copied Thumbnail" title="SmarTeam CopyFilesToTest Files Successfully Copied Thumbnail" /></p><img class="alignleft size-medium wp-image-4637" title="Staples Easy Button" src="http://www.razorleaf.com/wp-content/uploads/2009/09/Staples-Easy-Button-250x250.png" alt="" width="120" height="120" />With every upgrade to ENOVIA SmarTeam (not to mention upgrades to CAD, Office and database platforms) there's no question about the <a href="http://www.razorleaf.com/2009/12/prod-test-dev-environments/" target="_self">benefits of building a test environment for validation</a> prior to a production roll-out.  An important piece of building a test environment is a <strong>properly configured test vault</strong>.  Quite often, a successful test doesn't require a complete copy of the entire production vault, so let's take a look at a simple process to copy specific files from a production system to a test environment on demand.  <span id="more-6657"></span>

To get started, build a working ENOVIA SmarTeam test environment with a copy of the production database, scripts, configuration files, NLS files, and icons (learn more about <strong>ENOVIA SmarTeam environment duplication details</strong> <a href="http://www.razorleaf.com/2009/04/avoiding-test-vault-pitfalls-in-smarteam/" target="_self">here</a>).  Identify and configure the test vaults you'll be copying the files to.  <em><strong>Important Note:</strong></em>  When building a test environment, ensure that the <strong>ENOVIA SmarTeam Vault Server Setup</strong> tool is pointing to the newly created test vaults and not the production vaults. <img class="alignright size-medium wp-image-5162" title="Free Sign" src="http://www.razorleaf.com/wp-content/uploads/2009/10/Free-Sign-250x199.jpg" alt="" width="150" height="119" />To keep things simple, the example script for this article (request the <strong>free sample code</strong> by <a href="http://www.razorleaf.com/contact" target="_self">contacting us</a>) has just three possible destination vaults: Checked In, Released, and Obsolete.  Record the UNC paths of each of these destination (test) vaults and setup NTFS permissions on them so that the logged-in Windows user has write access.

Note that this script will copy files for each object selected.  It will not copy other revisions of selected objects, nor will it automatically copy any linked objects (such as SolidWorks models if a drawing is selected).  The tool will, however, copy viewer files automatically (like PDFs used for rendition management).
<h3>Step One - Create the script file</h3>
Create a script file named <strong>CopyFilesToTest.bs</strong> in the script folder on the production environment.
<h3>Step Two - Copy the code to the script file</h3>
Open the script file you received from Razorleaf and copy/paste the text to the newly created <strong>CopyFilesToTest.bs</strong> script file.
<h3>Step Three - Modify Destination Vaults</h3>
The three destination vaults must be configured to match the location of the vaults on your test SmarTeam Vault Server.  The code that configures this is as follows:

CheckedInVault = "\\UNCPathToCheckedIn"

ReleasedVault = "\\UNCPathToReleased"

ObsoleteVault = "\\UNCPathToObsolete"

The screenshot below shows a sample configuration:
<p style="text-align: center;"><img class="aligncenter size-large wp-image-6777" title="SmarTeam CopyFilesToTest Script Vault Paths" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-Script-Vault-Paths-490x366.png" alt="" width="490" height="366" /></p>
&nbsp;

Note that the full UNC path must be enclosed within quotations.   Remember to configure NTFS permissions to allow the logged-in Windows user to write to the UNC paths.
<h3>Step Four - Hook the script</h3>
Hook the script function to a <strong>User-Defined Tool (UDT)</strong> on the Documents super class in ENOVIA SmarTeam using the <strong>Script Maintenance</strong> tool.
<p style="text-align: center;"><img class="aligncenter size-large wp-image-6778" title="SmarTeam CopyFilesToTest Script Maintenance" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-Script-Maintenance-490x378.png" alt="" width="490" height="378" /></p>
&nbsp;

&nbsp;
<p style="text-align: center;"><strong><img class="aligncenter size-large wp-image-6779" title="SmarTeam CopyFilesToTest Script Browser" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-Script-Browser-490x346.png" alt="" width="490" height="346" /></strong></p>

<h3>Step Five - Run the Script</h3>
Finally, identify objects for the file transfer.  This can be either from browsing a Documents tree or performing a search.  <strong>CTRL</strong> or <strong>SHIFT</strong> + left-click to select one or more objects.  Once the desired objects are selected, simply right-click, select <strong>User Defined Tools</strong> and choose <strong>Copy Files to Test</strong>.
<p style="text-align: center;"><img class="aligncenter size-full wp-image-6782" title="SmarTeam CopyFilesToTest UDT" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-UDT.png" alt="" width="409" height="307" /></p>
A confirmation message will be shown if successful.
<p style="text-align: center;"><img class="aligncenter size-full wp-image-6783" title="SmarTeam CopyFilesToTest Files Successfully Copied" src="http://www.razorleaf.com/wp-content/uploads/2010/02/SmarTeam-CopyFilesToTest-Files-Successfully-Copied.png" alt="" width="168" height="84" /></p>
Browse to the SmarTeam Vault Server test location using Windows Explorer to ensure the files were copied as expected.  Since the <strong>CopyFilesToTest.bs</strong> script is installed on the production environment, permissions should be set on the UDT to only allow access to an administrator.
<h3>Summary</h3>
With the test files copied, validation can begin in the test system using copies instead of the actual production files.  Not only is this a <strong>time saver</strong>, but user acceptance testing can be performed on files familiar to the users.  Please leave us a comment below to let us know what you think of the tool and if you have ideas for improving it.]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/02/smarteam-vault-data-xfer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-Incrementing Build Numbers in Visual Studio.NET</title>
		<link>http://www.razorleaf.com/2010/01/auto-incrementing-visual-studio/</link>
		<comments>http://www.razorleaf.com/2010/01/auto-incrementing-visual-studio/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:30:49 +0000</pubDate>
		<dc:creator>Paul Luc</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Revision Control]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=6041</guid>
		<description><![CDATA[Every Windows executable binary file (EXE, DLL, etc) has a version consisting of the following elements and format: Major.Minor.Build.Revision.  To many software users, this is just  <a href="http://www.razorleaf.com/2010/01/auto-incrementing-visual-studio/">Read More...</a>]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2010/01/auto-incrementing-visual-studio/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>EPDM Dispatch for File Renaming</title>
		<link>http://www.razorleaf.com/2009/12/dispatch/</link>
		<comments>http://www.razorleaf.com/2009/12/dispatch/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 04:00:11 +0000</pubDate>
		<dc:creator>Daniel Rohats</dc:creator>
				<category><![CDATA[Developer's Corner]]></category>
		<category><![CDATA[Development / Programming]]></category>
		<category><![CDATA[Product Data Management]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[SolidWorks Enterprise PDM]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Dispatch Tool]]></category>
		<category><![CDATA[Enterprise PDM]]></category>
		<category><![CDATA[EPDM]]></category>
		<category><![CDATA[procedural language]]></category>
		<category><![CDATA[SolidWorks]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://www.razorleaf.com/?p=5921</guid>
		<description><![CDATA[<p><img width="135" height="80" src="http://www.razorleaf.com/wp-content/uploads/2009/12/EPDM-File-Rename-Thumbnail.png" class="attachment-post-thumbnail wp-post-image" alt="EPDM File Rename Thumbnail" title="EPDM File Rename Thumbnail" /></p><img class="alignleft size-medium wp-image-5637" title="SolidWorks EPDM Blueberry" src="http://www.razorleaf.com/wp-content/uploads/2009/12/SolidWorks-EPDM-Blueberry-223x250.png" alt="" width="86" height="96" />SolidWorks’ Enterprise PDM (EPDM) system contains what some might call a “poor man’s API” known as the Dispatch Tool.  The Dispatch Tool allows non-programmers (those who don’t write formal code in Visual Studio.NET) to create basic programs, scripts, and functions within EPDM without having to learn a programming language.  The tool is limited in functionality of course and is a procedural language, but it does provide a lot of ways to manipulate data inside EPDM.  This article highlights the capabilities of the Dispatch Tool through an example that renames a file with the information contained on the file’s Data Card.  Sample code for this example is provided.  <span id="more-5921"></span>

<img class="alignright size-medium wp-image-5162" title="Free Sign" src="http://www.razorleaf.com/wp-content/uploads/2009/10/Free-Sign-250x199.jpg" alt="" width="150" height="119" />To receive a copy of the code for this example (free of charge), please <a href="http://www.razorleaf.com/contact" target="_self">contact us</a> and request the EPDM Dispatch Sample Code.  The provided code file is already set up as an EPDM Administrative Action in the .ACN format.  To use this code, the Dispatch Tool must be configured on the EPDM Administrative Tree under the <strong>Add-Ins</strong> menu.  And to give credit where credit is due, this sample code is a derivative of a sample provided by SolidWorks.

Once you have the sample code, the .ACN file needs to be loaded into the system. Open EPDM Explorer View. Go to <strong>Tools</strong> -&gt; <strong>Administrative</strong> <strong>Actions</strong>, and then click the <strong>Load</strong> button to browse and select your .ACN file.  Once the .ACN is loaded, click the <strong>Edit</strong> button to review the code (shown in the screen shot below):
<p style="text-align: center;"><img class="size-full wp-image-5923  aligncenter" title="EPDM Dispatch Tool File Rename Example" src="http://www.razorleaf.com/wp-content/uploads/2009/12/EPDM-Dispatch-Tool-File-Rename-Example.png" alt="" width="422" height="461" /></p>
Here is a description of the key elements of the <strong>Edit Action</strong> window:

<strong>Action Name</strong>: Your “internal name” for the tool.

<strong>Description</strong>: A more detailed description of what the tool does.

<strong>Activation</strong>: You may choose when/how the action can be initiated.  The <strong>Menu</strong> <strong>command</strong> option is checked for this example and we have given a descriptive name (this will be displayed to the end user).

<strong>Commands</strong>: This is the meat and potatoes of the code where all the good stuff happens.  Below is a detailed list of each line in the code:
<ul>
	<li><strong>For all documents</strong>: This lets the program know that this command is for documents only. It is not for BOMs, Items, or Folders.  This also allows the user to multi-select several files and apply the command to them at one time.</li>
	<li><strong>Jump</strong>: This line checks to make sure the variable that is used to rename the file has at least 1 number or character in it.  You can change this value to whatever character length that you need, for example if your ERP system always needs an 8-digit number you could check to make sure that it is exactly 8 digits.  If this check is not performed, then you risk have a file with no name and an extension only.  If it passes this check, the code jumps to the “rename file” line, if not, it goes to the next line.</li>
	<li><strong>OK Message Box</strong>: This will tell the user that the file was not renamed because there was no value in the data card variable “Number.”</li>
	<li><strong>Jump</strong>: This line takes the command to the end of the loop “Skip Rename” when the file is skipped due to a blank Number field.</li>
	<li><strong>Label</strong>: Rename File is where the commands are picked back up once all the checks are passed.</li>
	<li><strong>Rename File</strong>: This line takes the path of the selected file, minus the extension, and renames it to a Dispatch Variable called “new_filename.”  See below for a more detailed description of this variable.</li>
	<li><strong>Label</strong>: Skip Rename</li>
	<li><strong>End for all documents</strong>: Ends the command lines.</li>
	<li><strong>Ok Message Box</strong>: Tells the user that the file has been renamed successfully.</li>
</ul>
The Dispatch variable used to rename the file is called “new_filename.”  This variable takes the Data Card variable “Number,” puts it into a Dispatch variable called “DocNumber,” and combines it with the Dispatch variable “file_extension.”  The proper EPDM names for these variables are %DocNumber% and %file_extension%. 

Naturally, the Dispatch Tool can perform many useful actions, and you don’t need to be a programmer to take advantage of its automation capabilities.  If you’re wondering what sorts of things are possible with the tool, or have a specific idea that you’d like to discuss, please <a href="http://www.razorleaf.com/contact" target="_self">contact us</a>.]]></description>
		<wfw:commentRss>http://www.razorleaf.com/2009/12/dispatch/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
