<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://bobbycjones.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fbobbycjones.spaces.live.com%2fcategory%2fCustomization%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Bobby C. Jones: Customization</title><description /><link>http://BobbyCJones.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catCustomization</link><language>en-US</language><pubDate>Sun, 08 Jun 2008 13:10:51 GMT</pubDate><lastBuildDate>Sun, 08 Jun 2008 13:10:51 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://BobbyCJones.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>3041750797314326904</live:id><live:alias>BobbyCJones</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>There's Power Under There</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!236.entry</link><description>&lt;div&gt;Before I get into the CAD stuff, I need to share a little something that you may find useful.  A while back I read a &lt;a href="http://www.amazon.com/gp/redirect.html%3FASIN=0960170618%26tag=bocjo-20%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/0960170618%253FSubscriptionId=1KDHEGDEXZNBKYAEECR2"&gt;book on speed reading&lt;/a&gt;.  And guess what, despite the &amp;quot;As Seen on TV!&amp;quot; warning on the front cover, it really works.  My casual reading speed has increased 100% without any loss of comprehension or retention.  I'm now working on actually increasing comprehension and retention while maintaining my increased speed.  One of the methods the book suggests to do that is to increase your vocabulary.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I thought that I had a fairly decent vocabulary, but I tried an exercize outlined in the book.  Anytime I came across a word that I didn't fully understand, I stopped reading and looked it up.  The theory is that eventually your vocabulary will increase, you'll start spending less time in the dictionary, and your reading speed will increase as your grasp of the language increases.  No kidding, on the first page that I read after starting this exercize, I found three words that I either didn't know at all, or only had a vague or partial understanding of the meaning.  The words were pique, balefully, and diatribe.  And let me tell you, after looking up these words and fully grasping their meaning, that part of the story took on a whole new dimension.  I fully encourage you to give this experiment a try, even if you believe that your vocabulary is already Brobdingnagian.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Just like a large vocabulary is a key to success with language, knowledge of system variables is a key to success with AutoCAD.  One of my old AutoLISP books had a huge section in the back that listed all of the AutoCAD system variables.  It was instrumental in my early success with AutoCAD.  I still try to keep up with all of the new ones, but I do miss a few.  Here's one that a co-worker taught me about today: &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;PUBLISHALLSHEETS&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;It controls whether or not the PUBLISH command brings in the layout tabs from just the current drawing or from all open drawings.  That one created some monster plot jobs before we figured out what was going on!&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you're not familiar with system variables, start exploring, you'll like what you find.  If you think that you're well versed in them, give them another look.  I promise that you'll rediscover variables that you forgot about and you may even find one or two that you never knew existed.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+There's+Power+Under+There&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!236.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!236.entry</guid><pubDate>Thu, 12 Jul 2007 03:17:06 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!236/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!236.entry#comment</wfw:comment><dcterms:modified>2007-07-12T03:18:23Z</dcterms:modified></item><item><title>Visual Studio 2005 Code Snippets for the AutoCAD .NET API - Part 2</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!206.entry</link><description>&lt;p&gt;
&lt;p&gt;Now that you've decided that Code Snippets are greatest thing since dual core processors, you've learned the basics of creating and managing them, and you've learned of some of their more advanced features, let's look at a few snippets specific to AutoCAD.  One word of warning, all of these examples are for C#.  I'll see if I can get VB versions coded up and posted; or even better, I'll be more than happy to post your VB translations of them! 
&lt;p&gt; One of my most used snippets is one for starting a Transaction.  It is an Expansion and a SurroundsWith snippet. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:maroon"&gt;xml&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;version&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;encoding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;?&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Format&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Start a Transaction&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Bobby C. Jones&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Inserts a &amp;quot;using(Transaction...)&amp;quot; code block.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;tr&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SurroundsWith&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Autocad&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;database&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Replace with the database that owns the transaction.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;HostApplicationServices.WorkingDatabase&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Language&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;CSharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;![CDATA[&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &lt;/span&gt;&lt;span style="color:gray"&gt;using(Transaction trans = $database$.TransactionManager.StartTransaction())&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;        {&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          $selected$&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          $end$&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          trans.Commit();&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;        }&lt;/span&gt;&lt;span style="color:blue"&gt;]]&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;  Another common snippet is one that opens a Database object. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:maroon"&gt;xml&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;version&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;encoding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;?&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Format&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Open DBObject&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Bobby C. Jones&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Opens a DBObject using an existing Transaction.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;open&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Autocad&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Type&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Replace with the type of the object to open.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.DatabaseServices.DBObject)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;ObjVarName&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Replace with the objects variable name.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;dbObject&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;TransVarName&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Replace with the name of your Transaction variable.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;trans&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;ObjectIdToOpen&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Replace with the ObjectId to open.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;objectID&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;OpenMode&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;OpenMode for opening the DBObject&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.DatabaseServices.OpenMode)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Language&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;CSharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;![CDATA[&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;        $Type$ $ObjVarName$ = ($Type$)$TransVarName$.GetObject($ObjectIdToOpen$, $OpenMode$);&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;        $end$&lt;/span&gt;&lt;span style="color:blue"&gt;]]&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here's a snippet to insert code that asks the user to select an entity, Editor.GetEntity().  I like this one, and snippets that insert the other GetXXX calls, because there can be a lot of setup code for the call and a lot of code to check the return values.  It's easy code, but involves a lot of typing, unless you use a snippet to insert it of course. 
&lt;p&gt;  
&lt;div style="font-size:10pt;background:white;color:black;font-family:Consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:maroon"&gt;xml&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;version&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;encoding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;?&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Format&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Get Entity&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Bobby C. Jones&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Allows the user to select a single entity.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;GetEnt&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Autocad&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keyword&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Keywords&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;PromptEntityOptions&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.EditorInput.PromptEntityOptions)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;PromptEntityResult&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.EditorInput.PromptEntityResult)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;PromptStatus&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.EditorInput.PromptStatus)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Prompt&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Prompt to display to the user.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Select an entity&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;editor&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;The current Editor object.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Application.DocumentManager.MdiActiveDocument.Editor&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Language&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;CSharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;![CDATA[&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          //Create a new entity selection options object&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          $PromptEntityOptions$ entitySelectionOpts = new $PromptEntityOptions$(&amp;quot;\n$Prompt$: &amp;quot;);&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          $end$&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          //Start the selection process&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          $PromptEntityResult$ entitySelectionResult = $editor$.GetEntity(entitySelectionOpts);&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="color:gray"&gt;          //Exit if an entity is not selected&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          if (entitySelectionResult.Status != $PromptStatus$.OK)&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          {&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;            return;&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          }&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;          &lt;/span&gt;&lt;span style="color:blue"&gt;]]&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;While these examples show inserting small peices of code, there's nothing wrong with snippets that insert entire procedures, or groups of procedures, or even entire class skeletons. 
&lt;p&gt;  
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/autocad" rel=tag&gt;autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/cad management" rel=tag&gt;cad management&lt;/a&gt;, &lt;a href="http://technorati.com/tags/programming" rel=tag&gt;programming&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/visual Studio" rel=tag&gt;visual Studio&lt;/a&gt;, &lt;a href="http://technorati.com/tags/code snippet" rel=tag&gt;code snippet&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Visual+Studio+2005+Code+Snippets+for+the+AutoCAD+.NET+API+-+Part+2&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!206.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!206.entry</guid><pubDate>Sun, 04 Feb 2007 14:50:09 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!206/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!206.entry#comment</wfw:comment><dcterms:modified>2007-02-04T15:15:01Z</dcterms:modified></item><item><title>Visual Studio 2005 Code Snippets for the AutoCAD .NET API</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!203.entry</link><description>&lt;p&gt;In a &lt;a href="http://bobbycjones.spaces.live.com/blog/cns!2A36783BF92E8178!170.entry"&gt;previous article&lt;/a&gt; I discussed how to use Visual Studio Code Snippets to reduce the amount of typing, the number of typos, and coding errors resulting from those typos.  In this follow up article I'm going to show you where to find basic information on creating your own snippets, discuss when to use them instead of creating utility libraries, and talk about some of the more advanced features.  I'll follow up this article with some example snippets specific to accessing the AutoCAD .NET API. 
&lt;h1&gt;The Basics&lt;/h1&gt;
&lt;p&gt;There is a lot of information on the net on creating and managing snippets.  I'm not going to rehash the basics here, but I will hit some highlights before passing you off to other sites that will get you up and running with creating basic code snippets and how to manage them. 
&lt;ul&gt;
&lt;li&gt;VS Code Snippets are simple XML files with a .snippet file extension. 
&lt;li&gt;The schema is simple and the files are easily editable. 
&lt;li&gt;The Visual Studio Code Snippets Manager is used to import and manage snippets. 
&lt;li&gt;Snippets can be created for C#, VB, J#, and XML, but they are language specific and one snippet will not work for multiple languages. 
&lt;li&gt;VB snippets can set references to other assemblies and Import namespaces, C# snippets cannot.&lt;/ul&gt;
&lt;p&gt;The sites listed below will get you up to speed on all of those basics and more. 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://dotnetjunkies.com/Article/C95AC204-DE44-4D4A-A2B7-1EB1BE14A8A1.dcik" target="_blank"&gt;dotnetjunkies&lt;/a&gt; 
&lt;li&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/122105-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/122105-1.aspx"&gt;4 Guys From Rolla&lt;/a&gt; 
&lt;li&gt;&lt;a title="MSDN - Creating and Using IntelliSense Code Snippets" href="http://msdn2.microsoft.com/en-us/library/ms165392(VS.80).aspx" target="_blank"&gt;MSDN - Creating and Using IntelliSense Code Snippets&lt;/a&gt; 
&lt;li&gt;&lt;a title="MSDN - Code Snippet Schema Reference" href="http://msdn2.microsoft.com/en-us/library/ms171418(vs.80).aspx" target="_blank"&gt;MSDN - Code Snippet Schema Reference&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.google.com/search?hl=en&amp;amp;q=visual+studio+code+snippets" target="_blank"&gt;Google&lt;/a&gt;&lt;/ul&gt;
&lt;p&gt;The problem with most of these sites is that they cover the basics, and they cover them well, but then they stop.  The MSDN sites contain information beyond the basics, but it's not always easy to find.  In the remainder of this article I will move beyond the basics and answer some burning snippet questions. 
&lt;h1&gt;Snippets vs. Utility Classes&lt;/h1&gt;
&lt;p&gt;When I first started creating snippets I found that they did speed up the coding process.  It didn't take long, however, before I asked myself when should I create a code snippet versus when should I create little helper utility classes.  I actually flailed around a bit on this one before deciding that for most of what I was doing, gluing together bits and pieces of the AutoCAD .NET API, code snippets were the better choice.  Here's some guidance, the only thing that I could find other than what I found from my own experiences, from the &lt;a href="http://forums.microsoft.com/msdn/showpost.aspx?postid=61654&amp;amp;siteid=1#_Toc109549607" target="_blank"&gt;MSDN site&lt;/a&gt;: 
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;While a component API is normally used to accomplish one particular, highly specialized task and may consist of hundreds or thousands lines of code, code snippets have more of a ‘connect the dots’ characterization and should be used for simple tasks. You could use a code snippet to demonstrate how to use several apis in conjunction to accomplish a particular goal, e.g. reading the contents of a text file. Inserting a code snippet into code can have an educative purpose for the user, since she actually sees the code that implements a particular functionality. Code snippets also allow for a higher degree of customization because of the replacement fields.&lt;/em&gt;&lt;/blockquote&gt;
&lt;p&gt;As programmers we're lazy and we want to use tools to decrease the amount of actual typing required to write our code.  There will be times when a reusable utility class, or component, is a good choice, but put some thought into the problem first and see if creating a custom code snippet isn't the better option. 
&lt;h1&gt;Functions in Snippets&lt;/h1&gt;
&lt;p&gt;Snippets for C# support Functions that run when the snippet is inserted and modify what the snippet inserts.  There are three built in functions: GenerateSwitchCases(), ClassName(), and SimpleTypeName().  Of these three I use the SimpleTypeName() often in my custom snippets.  This function reduces the call to the supplied Type to as short as possible.  Here is an excerpt from a snippet that uses the SimpleTypeName() function. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;PromptEntityOptions&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SimpleTypeName(Autodesk.AutoCAD.EditorInput.PromptEntityOptions)&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;First note the attribute, Editable, is set to false.  If this attribute is omitted it defaults to true.  A Literal with Editable set to false defines a replacement element that the user doesn't fill out.  Instead you can use the SimpleTypeName Function to fill out the replacement element. 
&lt;p&gt;In the above example all occurrences of &lt;em&gt;$PromptEntityOptions$&lt;/em&gt; in the snippet will be replaced with the fully qualified name, &lt;em&gt;Autodesk.AutoCAD.EditorInput.PromptEntityOptions&lt;/em&gt;.  That is unless a &lt;em&gt;using&lt;/em&gt; statement is at the top of the class: 
&lt;p&gt;using Autodesk.AutoCAD.EditorInput; 
&lt;p&gt;When this &lt;em&gt;using&lt;/em&gt; statement exists the SimpleTypeName() function shortens the fully qualified name to, &lt;em&gt;PromptEntityOptions&lt;/em&gt;.  I do not have any examples of custom snippets using any of the other Functions, but you can read all about them on &lt;a href="http://msdn2.microsoft.com/en-us/library/ms242312(VS.80).aspx" target="_blank"&gt;MSDN&lt;/a&gt;. 
&lt;p&gt;Functions are unfortunately only supported in C# and J#, VB snippets do not support them. 
&lt;h1&gt;Snippet Types&lt;/h1&gt;
&lt;p&gt;There are three types of snippets, Expansion, SurroundsWith, and Refactoring.  A custom code snippet can be assigned as Expansion or SurroundsWith, or both.  Custom snippets cannot be assigned as a Refactoring snippet. 
&lt;p&gt;An Expansion snippet simply expands the code defined in the snippet at the current cursor location.  A SurroundsWith snippet will be placed around any lines of code that are selected.  This snippet excerpt shows a snippet that is both an Expansion and a SurroundsWith snippet.  I'll provide the full snippet in my follow up article. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Start a Transaction&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Bobby C. Jones&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Inserts a &amp;quot;using(Transaction...)&amp;quot; code block.&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;tr&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;SurroundsWith&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To use this snippet as an Expansion snippet, type the shortcut, &lt;em&gt;tr&lt;/em&gt;, and hit the Tab key twice.  The code expands at the cursor location. 
&lt;p&gt;To use it as a SurroundsWith snippet, select some existing lines of code, right click to pull up the context menu, and select the Surround With... option.  Navigate to the desired snippet and select it.  The snippet code will surround the code that was highlighted. 
&lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=100 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9UaA26yuUrCXkS98HuF7eUqhHwpRkNfO9TQsa16nfmNxXdHk5ghT2JWwU4vDhFMlMrKtJn5xbX4jnX0m2mXlD0sSSprry335pPM1WGcvFkdVQ" width=179 border=0&gt; 
&lt;p&gt;In order for this to work the snippet code must contain a marker that designates where the existing highlighted lines of code will be placed inside the code created by the snippet.  This marker is the &lt;em&gt;$selected$&lt;/em&gt; marker.  It's surrounded by the $ character just like the normal replacement markers described in the basic sites above.  In the excerpt below, which comes from the same snippet as the excerpt above, the existing selected lines of code will be placed inside the &lt;em&gt;using&lt;/em&gt; statement created by the snippet. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Language&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;CSharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &amp;lt;![CDATA[&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;  &lt;/span&gt;&lt;span style="color:gray"&gt;using(Transaction $TransactionVariableName$ = $database$.TransactionManager.StartTransaction())&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;  {&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;    $selected$&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;    $end$&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;    $TransactionVariableName$.Commit();&lt;br&gt;&lt;/span&gt;&lt;span style="color:gray"&gt;  }&lt;/span&gt;&lt;span style="color:blue"&gt;]]&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This snippet also shows another special marker, the &lt;em&gt;$end$&lt;/em&gt; marker.  This marker will determine the placement of the cursor after the snippet code is inserted into the editor.  An &lt;em&gt;$end$&lt;/em&gt; marker can be placed in Expansion snippets as well. 
&lt;p&gt;I'm following this article up with a few of my favorite snippets.  Enjoy and be sure and let me know what interesting snippets you come up with! 
&lt;p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/Autocad" rel=tag&gt;Autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/cad management" rel=tag&gt;cad management&lt;/a&gt;, &lt;a href="http://technorati.com/tags/visual Studio" rel=tag&gt;visual Studio&lt;/a&gt;, &lt;a href="http://technorati.com/tags/code snippet" rel=tag&gt;code snippet&lt;/a&gt;, &lt;a href="http://technorati.com/tags/programming" rel=tag&gt;programming&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Visual+Studio+2005+Code+Snippets+for+the+AutoCAD+.NET+API&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!203.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!203.entry</guid><pubDate>Fri, 02 Feb 2007 22:00:48 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!203/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!203.entry#comment</wfw:comment><dcterms:modified>2007-02-04T14:59:27Z</dcterms:modified></item><item><title>Autodesk University 2006</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!183.entry</link><description>&lt;p&gt;I realize that it's rather late to post something on &lt;a href="http://www.autodeskevents.com/au2006/"&gt;AU 2006&lt;/a&gt;, but I just received an email that reminded me of the experience, the good and the bad.
&lt;p&gt;Let's start with the bad.  This year I registered late and got a room at &lt;a href="http://www.harrahs.com/casinos/flamingo-las-vegas/hotel-casino/property-home.shtml?source=AVA00000004980"&gt;The Flamingo&lt;/a&gt;.  Let me tell you, it's a real piece of &lt;a href="http://www.lvol.com/lvoleg/hist/lvhist.html"&gt;Las Vegas history&lt;/a&gt;.  They didn't have any rooms on the higher floors, which in retrospect was OK since I wasn't about to shell out an extra $40.00 a night for a room overlooking the strip anyway.  The room itself was very comfortable and, thanks to the paper thin walls, I got know my neighbors intimately.  
&lt;p&gt;On the one side was a cowboy and his cowgirl in town for the &lt;a href="http://www.nfrexperience.com/"&gt;Wrangler National Finals Rodeo&lt;/a&gt;.  I never found out if either were contestants or just spectators, but that night she took the bull by the horns and he rode right on past that &lt;a href="http://www.longhornrodeo.com/bullriding.htm"&gt;8 second horn&lt;/a&gt;.  I felt like a rodeo clown trapped in a barrel on the wrong side of the arena.  By 10:30 or 11:00 that night all events were complete and scores tallied.  I curled up in bed and was asleep before hearing who won and started dreaming of all the wonderful classes that I'd be attending the next day.
&lt;p&gt;Around 3:00 that morning I was ripped from sleep by mysterious loud noise, actually a series of rhythmic loud noises.  It took me a few minutes to realize what was happening.  My other neighbor must have been inspired by the rodeo two doors down, who knew the walls were &lt;em&gt;that&lt;/em&gt; thin, and had called in a professional to help him work out his animalistic desires.  All of their rockin' -n- rollin' shook my bed so that I was soon overcome by seasickness and had to go sit on the couch for a while.  Finally they finished and I was able to get back in bed.  About that time she left and banged the door shut hard enough to rattle me nearly right out of the bed again.
&lt;p&gt;Other than my sex sandwich hotel room I really had a great time at AU.  I met a lot of great people, ate a lot of free meals, much thanks to the &lt;a href="http://www.autodesk.com/buzzsaw"&gt;Buzzsaw team&lt;/a&gt;, &lt;a href="http://www.asti.com/"&gt;Applied Software&lt;/a&gt;, and the AU organizers, and really enjoyed the &lt;a href="http://www.venetian.com/BlueManGroup/"&gt;Blue Man Group&lt;/a&gt;.
&lt;p&gt;This year I once again had the honor of speaking.  It was the same class that I've done for the past 3 years, &lt;em&gt;The AutoCAD .NET API: The New Frontier&lt;/em&gt;.  Today we received our evaluation results.  If you've never been to AU before, for each class you fill out an evaluation where you rate the speaker and the class.
&lt;p&gt;I really want to thank everyone for their positive feedback.  It was a great class and I'm looking forward to updating my examples for an even better class next year.
&lt;p&gt;Obviously not everyone that uses Autodesk products is able to attend AU.  Autodesk realizes this and has created a web site, &lt;a href="http://au.autodesk.com/"&gt;Autodesk University Online&lt;/a&gt;, where the material presented at AU can reach a much wider audience.  Your free registration will allow you to view all of the courses, download handouts, and network with the speakers and other AU Online members.
&lt;p&gt;For the past two years the AU team has recorded some of the live classes as screencasts.  These screencasts are available for download to AU attendees and subscription customers.  My class was one of the ones recorded.  If you're suffering from insomnia it's the perfect cure.  &lt;a href="http://au.autodesk.com/sessions/generaldesign/detail/16767/"&gt;Go check it out&lt;/a&gt; and don't hesitate to shoot any comments or suggestions my way.
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/autocad" rel=tag&gt;autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/cad management" rel=tag&gt;cad management&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Autodesk+University+2006&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!183.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!183.entry</guid><pubDate>Thu, 18 Jan 2007 22:34:58 GMT</pubDate><slash:comments>6</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!183/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!183.entry#comment</wfw:comment><dcterms:modified>2007-01-23T19:58:07Z</dcterms:modified></item><item><title>Visual Studio 2005 Code Snippets</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!170.entry</link><description>&lt;p&gt;In my last article I let the cat out of the bag and told the world that a key of some, if not most, successful programmers is laziness.  And lazy programmers enjoy nothing more than tools that make their jobs easier.  In this article we'll talk about a Visual Studio tool for inserting blocks of pre-created code with only a couple of keystrokes.  They are called Code Snippets.  Code Snippets greatly speed up code generation by reducing the amount of typing and by inserting blocks of correct code.  And the good news is that if you have used Intellisense in Visual Studio, then you already know how to use Code Snippets.
&lt;p&gt;The first image below shows a blank code file.  In it I started typing and the Intellisense drop down popped up displaying all of the available Code Snippets.  Notice the scroll bar, there are a lot of snippets from which to choose.  Next I simply highlighted the desired snippet, in this case the &lt;em&gt;class&lt;/em&gt; snippet, and hit the Tab key.  Visual Studio finished typing the word &lt;em&gt;class&lt;/em&gt; in the editor.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=205 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9VW4OKbMIP_bMGpG-4nfLBPaVSDCQk30A3My-M-fp5rkK9gFy9r4-w7bHdliWaRrWxqAyTQFPaj1-SSDNu7FyugCQYslmcy1-G7tlZFbKsbOQ" width=287 border=0&gt; 
&lt;p&gt;However the real magic doesn't happen until I hit the Tab key again.  As soon as I do, Visual Studio inserts all necessary code for a class.  The class name is highlighted and ready for me to type in my class name.  Here I named it &lt;em&gt;SnippetExample&lt;/em&gt;.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=124 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9X2DQ8mxPGCdPB1bx_fJBLdKVAAr_sKEyXaPjUnwvDDA5HeAGgI7qTpaGzMh10y5TGCh2oA0xWzcQg2lUslvwgR4zUuSNJGc-q0NZk1Yysd0w" width=233 border=0&gt; 
&lt;p&gt;I then type &lt;em&gt;sim,&lt;/em&gt; the name of the snippet to create a static int Main function, and hit the Tab key twice.  Visual Studio spits out the function.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=189 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9WPKU4L-l1rra1ebRXDs5T5Fz1ks0SyfPk6xCmWM_ZqSexKoRorlH3JDBOCV4jgVIDzVefhghpWmkrvpwuSKjf1hEce036_aXrIDNKjtto39Q" width=318 border=0&gt; 
&lt;p&gt;I then type &lt;em&gt;fi&lt;/em&gt; and scroll to the filWriteText snippet. 
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=303 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9UMyvhgqOHn5q2URYgPyy1ukaUy05u0TJxRRV9nupi05mZTI2j2g8R0wLR4THIWc0FZ_-GXNMElbXzs0v1Fayum4nzlhVS7M16cofMbnWBQ2w" width=555 border=0&gt; 
&lt;p&gt;Two taps of the Tab key and all code necessary to write text to a file is created.  Two fields that need to be changed, the name of the file and the text to write to it, are highlighted.  Change these fields to the name of the file and the text you want to write to it, or the variables that hold that info.  Pressing the Tab key will alternate between them.  When you're finished modifying the fields simply press the Enter key.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=186 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9Xr6y8CX30Zq1mm1S5RWCd_kB-kuPiiuBGqU45wLfu8l7UpbR3Yxc5s_9EJN8w8BFKRjrKj6SMdnSByNho9C1n1mf0ddhfxN-TU_D80HU6CaQ" width=600 border=0&gt; 
&lt;p&gt;Some snippets are designed so that they can surround existing code.  Simply highlight the lines of code to be surrounded, right click and select the Surround With... option from the context menu.  In this example I navigated to the Visual C# folder and selected the while snippet.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=261 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9UfcFsDFQSRaQsQkrQHRo3agi-iShsceIv6Zps34bVPiywmDki0j7hl-YCcm94ceoaXpeYcltQHIcOzOzE0ZrGOYd3zqU6gqABeSvHP1AN6Rg" width=600 border=0&gt; 
&lt;p&gt;It placed a while loop around the selected code.
&lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=241 src="http://tk3.storage.msn.com/x1pYk0FlirMlE0vVdzFmJ13mJeW8UmgGGJ_b7tYANJuo9XKa-jtrFKAkddYb5X-8f47TQYrg8TvUn9_sgsQFVzYBj7-9wolJuQ7LyDJrl21kTcUmbjpMsxclmWv8pGGnkUk3wfmskts2XwTc6DFRmDllA" width=600 border=0&gt; 
&lt;p&gt;The snippets that I've shown here only insert a few lines of code.  There are other snippets that insert entire functions and groups of functions.  Do yourself a favor and browse through the list of snippets.  There is a Code Snippet Manager in the Tools menu.
&lt;p&gt;One final note before I leave you; if you are a C# programmer, go to the MSDN site and download some &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa718338.aspx"&gt;additional snippets&lt;/a&gt;.  These snippets come in the box for Visual Basic.
&lt;p&gt;In future articles I'll show you how to create your own snippets and share them with others.
&lt;p&gt;
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/Visual Studio" rel=tag&gt;Visual Studio&lt;/a&gt;, &lt;a href="http://technorati.com/tags/.net development" rel=tag&gt;.net development&lt;/a&gt;, &lt;a href="http://technorati.com/tags/C#" rel=tag&gt;C#&lt;/a&gt;, &lt;a href="http://technorati.com/tags/code snippet" rel=tag&gt;code snippet&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Visual+Studio+2005+Code+Snippets&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!170.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!170.entry</guid><pubDate>Sat, 13 Jan 2007 22:53:44 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!170/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!170.entry#comment</wfw:comment><dcterms:modified>2007-01-19T14:06:21Z</dcterms:modified></item><item><title>Programmer's are lazy</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!167.entry</link><description>&lt;p&gt;Programmer's are lazy, and without a doubt I'm somewhere near the top of the laziness heap.  I've known this for a long time, but just thought about it today while reading &lt;a href="http://otb.manusoft.com/2007/01/ill-take-web-sites-for-200-alex-part-i.htm"&gt;Owen Wengerd's adventures in blogging&lt;/a&gt;.
&lt;p&gt;My blogging adventures started with &lt;a href="http://www.blogger.com/"&gt;Blogger.com&lt;/a&gt;, but I didn't stick with it because it was just too...well, it was just too manual.  I recently found &lt;a href="http://spaces.live.com/"&gt;Spaces.live.com&lt;/a&gt; and jumped on board mainly due to the drag and drop ease it provides for site creation.  Compare that to Owen whose antipathy for the messy HTML code that FrontPage created snowballed into him purchasing a domain name, finding a web host, and building his own site from the &lt;a href="http://en.wikipedia.org/wiki/Comparison_of_content_management_systems"&gt;CMS&lt;/a&gt; up!  
&lt;p&gt;I personally don't think that all laziness is bad.  Laziness was my catalyst into programming and customizing AutoCAD.  I abhor mindless repetitive tasks and as soon as I discovered that I could automate those tasks with menu macros, script files, and AutoLISP, I was off to the races.  Instead of spending my time performing mind numbing CAD tasks, I spent my time learning about the buildings that I was drawing.  It wasn't long before I found myself at the top of the heap of CAD drafters.  Remind me to thank my dad for that lazy gene.
&lt;p&gt;So laziness has helped me get to where I'm at today and I plan to continue working very hard at being lazy so that I can get to where I want to go tomorrow.  Of course I'm not sure where that's at.  After I finish this quart of ice cream and wake from the ensuing nap, I'll considering getting up and researching it a bit.
&lt;p&gt; 
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/autocad" rel=tag&gt;autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/cad management" rel=tag&gt;cad management&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Programmer's+are+lazy&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!167.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!167.entry</guid><pubDate>Thu, 11 Jan 2007 18:29:57 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!167/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!167.entry#comment</wfw:comment><dcterms:modified>2007-01-24T20:49:39Z</dcterms:modified></item><item><title>Role With it Baby, or lock those AutoCAD documents in a safe place.</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!160.entry</link><description>&lt;p&gt;Today was just one of those days.  I tried counting the hats that I wore.
&lt;ol&gt;
&lt;li&gt;Teacher 
&lt;li&gt;Technologist 
&lt;li&gt;Accountant 
&lt;li&gt;Programmer 
&lt;li&gt;Draftsman 
&lt;li&gt;Technical Writer 
&lt;li&gt;Forecaster 
&lt;li&gt;Mover 
&lt;li&gt;Motivator 
&lt;li&gt;Politician&lt;/ol&gt;
&lt;p&gt;I'm sure this list is missing an item or four, and it certainly doesn't take into account the personal roles, like husband and father.  Don't get me wrong, I'm not complaining.  I actually found it all quite exhilarating.  And I imagine their are a number of CAD Managers looking at this list and thinking, &amp;quot;That's all&amp;quot;.
&lt;p&gt;But that is a lot of hats to wear.  So next time you see you CAD Manager, give him a hug.  He may just need it.  On to why you're really here; a quick tip about locking documents.
&lt;p&gt;When your code accesses a document from the application context, it needs to ensure that the document is locked.  Any code accessing a document from a palette, a pane object in either the document or application pane area, or a modal dialog is doing so from the Application context.
&lt;p&gt;The example below shows one way of locking a document in button click event of a User Control.
&lt;div style="font-size:8pt;background:white;color:black;font-family:consolas"&gt;&lt;pre&gt;&lt;span style="color:green"&gt;//Interaction with the database requires the document to be locked.&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; button2_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, &lt;span style="color:teal"&gt;EventArgs&lt;/span&gt; e)&lt;br&gt;{&lt;br&gt;  &lt;span style="color:blue"&gt;using&lt;/span&gt; (&lt;span style="color:teal"&gt;DocumentLock&lt;/span&gt; dl = &lt;span style="color:teal"&gt;acadApp&lt;/span&gt;.DocumentManager.MdiActiveDocument.LockDocument())&lt;br&gt;  {&lt;br&gt;    &lt;span style="color:teal"&gt;DatabaseExamples&lt;/span&gt; circleFactory = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;DatabaseExamples&lt;/span&gt;();&lt;br&gt;    circleFactory.DrawCircle();&lt;br&gt; &lt;br&gt;    &lt;span style="color:teal"&gt;acadApp&lt;/span&gt;.UpdateScreen();&lt;br&gt;  }&lt;br&gt;} &lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/Autocad" rel=tag&gt;Autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/cad management" rel=tag&gt;cad management&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Role+With+it+Baby%2c+or+lock+those+AutoCAD+documents+in+a+safe+place.&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!160.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!160.entry</guid><pubDate>Tue, 09 Jan 2007 22:35:56 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!160/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!160.entry#comment</wfw:comment><dcterms:modified>2007-01-19T14:06:35Z</dcterms:modified></item><item><title>Squirrels in the attic, or dispose those databases</title><link>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!139.entry</link><description>&lt;p&gt;
&lt;p&gt;I hope everyone has had a good new year so far.  We took a two week tour of the southern states and I'm glad to be back at work and sleeping in my own bed.  Not that I'm sleeping much.  We came home to squirrels in the attic.
&lt;p&gt;I trapped a couple of flying squirrels before we left.    Don't let the big eyes and the cute little ears fool you.  These are nothing more than mutant flying rats.  After waking to a 2:00 AM WWF vs. RAW match over our heads I picked up a couple of those rat sized glue traps baited with peanut butter and placed them around the attic.  I know, I'm evil.  You'll learn to like me anyway.
&lt;p&gt;At 3:30 that morning I heard one of the big eyed mutants flailing around.  Aha!  Victory; or so I thought.  The next day, I was too afraid to visit the attic at night, I went up to obtain my aerial acrobat trophy.   Instead I found that the flying squirrels had been evicted over the holidays and a new resident had taken over.   The glue traps were obviously too weak to hold him, but I'm sure that he'll think twice about snacking on peanut butter again! 
&lt;p&gt;Anyway, here's a little new years tip for you, non-squirrel related.  If you create a database, you &lt;strong&gt;must&lt;/strong&gt; dispose of it.  I prefer the C# using statement for this.&lt;pre&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt; (&lt;font color="#408080"&gt;Database&lt;/font&gt; newDb = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#408080"&gt;Database&lt;/font&gt;(&lt;font color="#0000ff"&gt;false&lt;/font&gt;, &lt;font color="#0000ff"&gt;true&lt;/font&gt;))&lt;br&gt;{&lt;br&gt;  newDb.ReadDwgFile(&lt;font color="#804000"&gt;&amp;quot;C:\\MyMarvelousDrawing.dwg&amp;quot;&lt;/font&gt;, &lt;br&gt;                     &lt;font color="#408080"&gt;FileShare&lt;/font&gt;.Read, &lt;br&gt;                     &lt;font color="#0000ff"&gt;false&lt;/font&gt;, &lt;br&gt;                     &lt;font color="#0000ff"&gt;null&lt;/font&gt;);&lt;/pre&gt;&lt;pre&gt;  &lt;font color="#008000"&gt;//perform miraculous miracles&lt;br&gt;  //on your marvelous dwg.&lt;/font&gt;&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;As soon as the using block is exited, .NET calls the .Dispose() method of the newDb object.  You could do the same with a Try..Catch..Finally block, but I prefer the compactness of the using statement.  Also remember, if AutoCAD creates the database, then you should not dispose of it.
&lt;p&gt;That's all for today.  I wish you all happy squirrel hunting.
&lt;p&gt; 
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/autocad" rel=tag&gt;autocad&lt;/a&gt;, &lt;a href="http://technorati.com/tags/customization" rel=tag&gt;customization&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;table cellspacing="0" border="0"&gt;&lt;tr height="8"&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;p&gt;&lt;a href="http://byfiles.storage.live.com&amp;#47;y1pF4Gi7vb3ojlPsKYoSHX0wxp_9eltdh_lXTSAaFxv58WmyzTuoTeYAg"&gt;&lt;img src="http://storage.live.com&amp;#47;items&amp;#47;2A36783BF92E8178&amp;#33;141&amp;#58;thumbnail" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="15"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;p&gt;&lt;a href="http://byfiles.storage.live.com&amp;#47;y1p0PYi3OeVCh7IijzDNFN5sOYklxykxDlakgyclhNtpZeAZASrdPJh7Q"&gt;&lt;img src="http://storage.live.com&amp;#47;items&amp;#47;2A36783BF92E8178&amp;#33;142&amp;#58;thumbnail" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="15"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3041750797314326904&amp;page=RSS%3a+Squirrels+in+the+attic%2c+or+dispose+those+databases&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=bobbycjones.spaces.live.com&amp;amp;GT1=BobbyCJones"&gt;</description><comments>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!139.entry#comment</comments><guid isPermaLink="true">http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!139.entry</guid><pubDate>Tue, 09 Jan 2007 20:04:55 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://BobbyCJones.spaces.live.com/blog/cns!2A36783BF92E8178!139/comments/feed.rss</wfw:commentRss><wfw:comment>http://BobbyCJones.spaces.live.com/Blog/cns!2A36783BF92E8178!139.entry#comment</wfw:comment><dcterms:modified>2007-01-19T14:07:22Z</dcterms:modified></item></channel></rss>