<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>AEC DevBlog</title>
<link>http://adndevblog.typepad.com/aec/</link>
<description />
<language>en-US</language>
<lastBuildDate>Tue, 18 Jun 2013 11:54:33 -0700</lastBuildDate>
<generator>http://www.typepad.com/</generator>

<docs>http://www.rssboard.org/rss-specification</docs>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AecDevblog" /><feedburner:info uri="aecdevblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
<title>Getting Started with Revit 2014 API and Family Guide</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/yd93cIp1R-I/getting-started-with-revit-2014-api-and-family-guide.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/06/getting-started-with-revit-2014-api-and-family-guide.html</guid>
<description>By Mikako Harada Last year, I wrote about my handy "Getting Started with Revit API" document (sometime I called it "phase zero") as I get inquiries about Revit API every so often. Here it is the updated version: Download Getting Started with Revit 2014 API. The changes are very minor:...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/mikako-harada.html" target="_self" title="Mikako Harada">Mikako Harada</a></p>
<p>Last year, I wrote about&#0160;my handy &quot;Getting Started with Revit API&quot; document (sometime I called it &quot;phase zero&quot;) as I get inquiries about Revit API&#0160;every so often.&#0160;Here it is the updated version:&#0160;&#0160;<span class="asset  asset-generic at-xid-6a0167607c2431970b0191037da892970c"><a href="http://adndevblog.typepad.com/files/getting-started-with-revit-2014-api.pdf">Download Getting Started with Revit 2014 API</a></span>. The changes are very minor: version number update and pointing to newer recordings. Old recordings&#0160;may be&#0160;still valuable for learning basics as the newer ones tend to focus on more advanced and specific topics.&#0160;So I&#39;m not going to repeat it here; rather&#0160;I&#0160;refer to the <a href="http://adndevblog.typepad.com/aec/2012/07/getting-started-with-revit-2013-api.html" target="_self" title="Getting Started with Revit API 2013">last year&#39;s page </a>for the majority of part. </p>
<p>Another inquiry I received recently is about&#0160;learning materials about Family creation. I double-checked the content manager here and he confirms that the&#0160;<a href="http://usa.autodesk.com/adsk/servlet/item?siteID=123112&amp;id=13376394" target="_self" title="Family Guide">Family Guide posted here </a>is still the most complete one you can refer to&#0160;(although it was not updated for a few years.)&#0160; This page include guides translated in various languages, such as Chinese, German, French, and Japanese. If you are new to Revit, this will be a good starting point to learn Family creation.&#0160;If you are coming from Programing background, I must also emphasize that&#0160;to master Revit API, you will need to understand how Revit works in UI. </p>
<p>Good luck!</p><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/yd93cIp1R-I" height="1" width="1"/>]]></content:encoded>


<category>.NET</category>
<category>Mikako Harada</category>
<category>Revit</category>

<dc:creator>Mikako Harada</dc:creator>
<pubDate>Tue, 18 Jun 2013 11:54:33 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/06/getting-started-with-revit-2014-api-and-family-guide.html</feedburner:origLink></item>
<item>
<title>Capture Escape key on Revit</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/mNtkQj-eAP4/capture-escape-key-on-revit.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/06/capture-escape-key-on-revit.html</guid>
<description>By Augusto Goncalves In some cases we need to hook to Revit to track some keys, for instance the ESCAPE key. This can be done with Win32 APIs with SetWindowsHookEx method. Below is the regular OnStartup and OnShutdown with calls to it. public Result OnStartup(UIControlledApplication application) { // hook HookMainApp();...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/augusto-goncalves.html">Augusto Goncalves</a></p>  <p>In some cases we need to hook to Revit to track some keys, for instance the ESCAPE key. This can be done with Win32 APIs with <strong>SetWindowsHookEx</strong> method. Below is the regular <strong>OnStartup</strong> and <strong>OnShutdown</strong> with calls to it.</p>  <div style="font-family: ; background: white; color: ">   <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">public</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#2b91af">Result</font></span><font color="#000000"> OnStartup(</font><span style="color: "><font color="#2b91af">UIControlledApplication</font></span><font color="#000000"> application)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// hook</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; HookMainApp();</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">return</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">Result</font></span><font color="#000000">.Succeeded;</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">public</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#2b91af">Result</font></span><font color="#000000"> OnShutdown(</font><span style="color: "><font color="#2b91af">UIControlledApplication</font></span><font color="#000000"> application)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// unhook</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; UnhookMainApp();</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">return</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">Result</font></span><font color="#000000">.Succeeded;</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">private</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">void</font></span><font color="#000000"> KeyPressed(</font><span style="color: "><font color="#2b91af">Keys</font></span><font color="#000000"> keyPressed)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">if</font></span><font color="#000000"> (keyPressed == </font><span style="color: "><font color="#2b91af">Keys</font></span><font color="#000000">.Escape)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; {</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">TaskDialog</font></span><font color="#000000">.Show(</font><span style="color: "><font color="#a31515">&quot;Key was pressed&quot;</font></span><font color="#000000">, </font><span style="color: "><font color="#a31515">&quot;Escape&quot;</font></span><font color="#000000">);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; }</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}&#160; </font></font></p> </div>  <p>And to make this work, also include the following methods on the project:</p>  <div style="font-family: ; background: white; color: ">   <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">#region</font></font></span><font style="font-size: 8pt" color="#000000"> &quot;Windows Hook&quot;</font></font></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// **********</font></font></span></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// Code based on the following post</font></font></span></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// http://www.pinvoke.net/default.aspx/user32.setwindowshookex</font></font></span></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// **********</font></font></span></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">private</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">void</font></span><font color="#000000"> HookMainApp()</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// initialize our delegate</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">this</font></span><font color="#000000">.myCallbackDelegate = </font><span style="color: "><font color="#0000ff">new</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">HookProc</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">this</font></span><font color="#000000">.MyCallbackFunction);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// get the process and set up the hook</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">using</font></span><font color="#000000"> (</font><span style="color: "><font color="#2b91af">Process</font></span><font color="#000000"> process = </font><span style="color: "><font color="#2b91af">Process</font></span><font color="#000000">.GetCurrentProcess())</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">using</font></span><font color="#000000"> (</font><span style="color: "><font color="#2b91af">ProcessModule</font></span><font color="#000000"> module = process.MainModule)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; {</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; hookId = SetWindowsHookEx(</font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">HookType</font></span><font color="#000000">.WH_KEYBOARD,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160;&#160;&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">this</font></span><font color="#000000">.myCallbackDelegate, </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000">.Zero,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160;&#160;&#160; (</font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">uint</font></span><font color="#000000">)</font><span style="color: "><font color="#2b91af">AppDomain</font></span><font color="#000000">.GetCurrentThreadId());</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; }</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">private</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">void</font></span><font color="#000000"> UnhookMainApp()</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; UnhookWindowsHookEx(hookId);</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">private</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> MyCallbackFunction(</font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> code, </font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> wParam, </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> lParam)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">if</font></span><font color="#000000"> (code &lt; 0)</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; {</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">//you need to call CallNextHookEx without</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// further processing and return the value</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// returned by CallNextHookEx</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160;&#160;&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">return</font></span><font color="#000000"> CallNextHookEx(</font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000">.Zero, code,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;&#160;&#160;&#160;&#160; wParam, lParam);</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; }</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// we can convert the 2nd parameter (the key code) </font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">// to a System.Windows.Forms.Keys enum constant</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">Keys</font></span><font color="#000000"> keyPressed = (</font><span style="color: "><font color="#2b91af">Keys</font></span><font color="#000000">)wParam.ToInt32();</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; KeyPressed(keyPressed);</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><span style="color: "><font style="font-size: 8pt" color="#008000">//return the value returned by CallNextHookEx</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">return</font></span><font color="#000000"> CallNextHookEx(</font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000">.Zero, code,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;&#160;&#160; wParam, lParam);</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// hook deleate</font></font></span></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">private</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#2b91af">HookProc</font></span><font color="#000000"> myCallbackDelegate = </font><span style="color: "><font color="#0000ff">null</font></span><font color="#000000">;</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#008000">// hook id for unhook</font></font></span></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#2b91af"><font style="font-size: 8pt">IntPtr</font></font></span><font style="font-size: 8pt" color="#000000"> hookId;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">[</font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">DllImport</font></span><font color="#000000">(</font><span style="color: "><font color="#a31515">&quot;user32.dll&quot;</font></span><font color="#000000">)]</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">static</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">extern</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> CallNextHookEx(</font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> hhk, </font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> nCode, </font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> wParam, </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> lParam);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">[</font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">DllImport</font></span><font color="#000000">(</font><span style="color: "><font color="#a31515">&quot;kernel32.dll&quot;</font></span><font color="#000000">)]</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">static</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">extern</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">uint</font></span><font color="#000000"> GetCurrentThreadId();</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">[</font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">DllImport</font></span><font color="#000000">(</font><span style="color: "><font color="#a31515">&quot;user32.dll&quot;</font></span><font color="#000000">, SetLastError = </font><span style="color: "><font color="#0000ff">true</font></span><font color="#000000">)]</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">[</font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">return</font></span><font color="#000000">: </font><span style="color: "><font color="#2b91af">MarshalAs</font></span><font color="#000000">(</font><span style="color: "><font color="#2b91af">UnmanagedType</font></span><font color="#000000">.Bool)]</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">static</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">extern</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">bool</font></span><font color="#000000"> UnhookWindowsHookEx(</font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> hhk);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">[</font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">DllImport</font></span><font color="#000000">(</font><span style="color: "><font color="#a31515">&quot;user32.dll&quot;</font></span><font color="#000000">, SetLastError = </font><span style="color: "><font color="#0000ff">true</font></span><font color="#000000">)]</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">static</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">extern</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> SetWindowsHookEx(</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">HookType</font></span><font color="#000000"> hookType, </font><span style="color: "><font color="#2b91af">HookProc</font></span><font color="#000000"> lpfn, </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> hMod,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#0000ff">uint</font></span><font color="#000000"> dwThreadId);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">public</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">enum</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">HookType</font></span><font color="#000000"> : </font></font><span style="color: "><font style="font-size: 8pt" color="#0000ff">int</font></span></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">{</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_JOURNALRECORD = 0,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_JOURNALPLAYBACK = 1,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_KEYBOARD = 2,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_GETMESSAGE = 3,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_CALLWNDPROC = 4,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_CBT = 5,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_SYSMSGFILTER = 6,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_MOUSE = 7,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_HARDWARE = 8,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_DEBUG = 9,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_SHELL = 10,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_FOREGROUNDIDLE = 11,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_CALLWNDPROCRET = 12,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_KEYBOARD_LL = 13,</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160; WH_MOUSE_LL = 14</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">}</font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><font face="Courier New"><span style="color: "><font color="#0000ff"><font style="font-size: 8pt">delegate</font></font></span><font style="font-size: 8pt"><font color="#000000"> </font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> </font><span style="color: "><font color="#2b91af">HookProc</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">int</font></span><font color="#000000"> code, </font><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> wParam,</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font color="#000000"><font style="font-size: 8pt">&#160; </font></font><font style="font-size: 8pt"><span style="color: "><font color="#2b91af">IntPtr</font></span><font color="#000000"> lParam);</font></font></font></p>    <p style="margin: 0px"><font face="Courier New"><font style="font-size: 8pt" color="#000000">&#160;</font></font></p>    <p style="margin: 0px"><span style="color: "><font face="Courier New"><font style="font-size: 8pt" color="#0000ff">#endregion</font></font></span></p> </div><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/mNtkQj-eAP4" height="1" width="1"/>]]></content:encoded>


<category>.NET</category>
<category>Revit</category>

<dc:creator>Augusto Goncalves</dc:creator>
<pubDate>Mon, 17 Jun 2013 12:54:10 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/06/capture-escape-key-on-revit.html</feedburner:origLink></item>
<item>
<title>Navisworks 2014 API new feature - ToolPlugin</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/czl2e63S2Ts/navisworks-2014-api-new-feature-toolplugin.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/06/navisworks-2014-api-new-feature-toolplugin.html</guid>
<description>By Xiaodong Liang ToolPlugin is actually a combination of InputPlugin and RenderPlugin. It allows you to customize the tool. Typically, it configures the behavior when mouse clicking the object. So you could switch between the native tool of Navisworks and your tools. Firstly, create a class deriving from ToolPlugin ....</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/xiaodong-liang.html" target="_self">Xiaodong Liang</a></p>  <p>ToolPlugin is actually a combination of <a href="http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-inputplugin.html">InputPlugin</a> and <a href="http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-renderplugin.html">RenderPlugin</a>. It allows you to customize the tool. Typically, it configures the behavior when mouse clicking the object. So you could switch between the native tool of Navisworks and your tools. </p>  <p>Firstly, create a class deriving from ToolPlugin . It is a kind of implicit plugin which has no interface. So the attribute DisplayName could be ignored. Next, override the methods you want to use. e.g. the following code demo overrides MouseDown and OverlayRenderModel. When the mouse clicks, it records the selected object, next draws a custom graphics with the bounding box of the object. In another word, when the mouse clicks the object, it will not highlight the object anymore, it will draw a temporary cuboids. </p>  <div style="font-family: courier new; background: white; color: black; font-size: 9pt">   <p style="margin: 0px"><span style="line-height: 140%; color: green">// The ToolPlugin example.</span></p>    <p style="margin: 0px"><span style="line-height: 140%">[</span><span style="line-height: 140%; color: #2b91af">Plugin</span><span style="line-height: 140%">(</span><span style="line-height: 140%; color: #a31515">&quot;ToolPluginTest&quot;</span><span style="line-height: 140%">, </span><span style="line-height: 140%; color: #a31515">&quot;ADSK&quot;</span><span style="line-height: 140%">)]</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">ToolPluginTest</span><span style="line-height: 140%"> : </span><span style="line-height: 140%; color: #2b91af">ToolPlugin</span></p>    <p style="margin: 0px"><span style="line-height: 140%">{</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">ModelItem</span><span style="line-height: 140%"> clickedModel = </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">override</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">bool</span><span style="line-height: 140%"> MouseDown(</span><span style="line-height: 140%; color: #2b91af">View</span><span style="line-height: 140%"> view,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">KeyModifiers</span><span style="line-height: 140%"> modifiers,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">ushort</span><span style="line-height: 140%"> button,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">int</span><span style="line-height: 140%"> x,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">int</span><span style="line-height: 140%"> y,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">double</span><span style="line-height: 140%"> timeOffset)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// get current selection        <br /></span><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">PickItemResult</span><span style="line-height: 140%"> itemResult = </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; view.PickItemFromPoint(x, y);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (itemResult != </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; clickedModel = </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; itemResult.ModelItem;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.ActiveDocument.ActiveView.</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RequestDelayedRedraw(</span><span style="line-height: 140%; color: #2b91af">ViewRedrawRequests</span><span style="line-height: 140%">.Render);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">false</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">override</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">void</span><span style="line-height: 140%"> OverlayRenderModel(</span><span style="line-height: 140%; color: #2b91af">View</span><span style="line-height: 140%"> view, </span><span style="line-height: 140%; color: #2b91af">Graphics</span><span style="line-height: 140%"> graphics)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (clickedModel != </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//color for graphics</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Color</span><span style="line-height: 140%"> yellow = </span><span style="line-height: 140%; color: #2b91af">Color</span><span style="line-height: 140%">.FromByteRGB(255, 255, 0);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; graphics.Color(yellow, 0.8);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//boundingbox of the current selection</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">BoundingBox3D</span><span style="line-height: 140%"> boundingBox = clickedModel.BoundingBox();</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Point3D</span><span style="line-height: 140%"> origin = boundingBox.Min;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%"> xVector =</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%">((boundingBox.Max - </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; boundingBox.Min).X, 0, 0);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%"> yVector = </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%">(0, (boundingBox.Max - </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; boundingBox.Min).Y, 0);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%"> zVector = </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Vector3D</span><span style="line-height: 140%">(0, 0, (boundingBox.Max -</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; boundingBox.Min).Z);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//draw a cuboid</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; graphics.Cuboid(origin, xVector, yVector, zVector, </span><span style="line-height: 140%; color: blue">true</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">} </span></p> </div>  <p>&#160;</p>  <p>To let Navisworks know to use your tool, you will need to write some codes in your main workflow (e.g. main plugin). Find your tool plugin, and set it as a current tool by </p>  <p><strong>Tool.SetCustomToolPlugin</strong></p>  <p>To switch back to the native tool of Navisworks, you could just set the tool to any mode of navigation. </p>  <div style="font-family: courier new; background: white; color: black; font-size: 9pt">   <p style="margin: 0px"><span style="line-height: 140%">[</span><span style="line-height: 140%; color: #2b91af">Plugin</span><span style="line-height: 140%">(</span><span style="line-height: 140%; color: #a31515">&quot;EnableToolPluginExample&quot;</span><span style="line-height: 140%">, </span><span style="line-height: 140%; color: #a31515">&quot;ADSK&quot;</span><span style="line-height: 140%">,        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DisplayName = </span><span style="line-height: 140%; color: #a31515">&quot;EnableToolPlugin&quot;</span><span style="line-height: 140%">)]</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">EnableToolPluginExample</span><span style="line-height: 140%"> : </span><span style="line-height: 140%; color: #2b91af">AddInPlugin</span></p>    <p style="margin: 0px"><span style="line-height: 140%">{</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">static</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">bool</span><span style="line-height: 140%"> enable = </span><span style="line-height: 140%; color: blue">false</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">override</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">int</span><span style="line-height: 140%"> Execute(</span><span style="line-height: 140%; color: blue">params</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%">[] parameters)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (enable)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//switch to the native tool       <br /> </span><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.MainDocument.Tool.Value = </span><span style="line-height: 140%; color: #2b91af">Tool</span><span style="line-height: 140%">.Select;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">else</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//switch to custom tool</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">ToolPluginRecord</span><span style="line-height: 140%"> toolPluginRecord = </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (</span><span style="line-height: 140%; color: #2b91af">ToolPluginRecord</span><span style="line-height: 140%">)</span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.Plugins.FindPlugin(</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot;ToolPluginTest.ADSK&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.MainDocument.Tool.</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SetCustomToolPlugin(toolPluginRecord.LoadPlugin());</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; enable = !enable;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> 0;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">}</span></p>    <p style="margin: 0px">&#160;<a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b0191030186da970c-pi"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aac9dfe0970d-pi" width="440" height="318" /></a> </p>    <p style="margin: 0px"></p> </div><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/czl2e63S2Ts" height="1" width="1"/>]]></content:encoded>


<category>.NET</category>
<category>Navisworks</category>
<category>Xiaodong Liang</category>

<dc:creator>Xiaodong Liang</dc:creator>
<pubDate>Wed, 05 Jun 2013 21:21:24 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/06/navisworks-2014-api-new-feature-toolplugin.html</feedburner:origLink></item>
<item>
<title>Copy family between documents via API</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/6Ezo7PfGCh8/copy-family-between-documents-via-api.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/copy-family-between-documents-via-api.html</guid>
<description>By Joe Ye Transferring standards and elements via API is hot API request before Revit 2014. Revit 2014 exposed the exciting API, copy element between documents. This give us the ability to do a lot of interesting jobs. Here is an sample to transfer family between documents. This command copy...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/joe-ye.html">Joe Ye</a></p>  <p>Transferring standards and elements via API is hot API request before Revit 2014. Revit 2014 exposed the exciting API, copy element between documents. This give us the ability to do a lot of interesting jobs. </p>  <p>Here is an sample to transfer family between documents. This command copy family to another opened document in the same Revit session. It copies all the types of the picked family instance’s family.</p>  <p>&#160;</p>  <div style="font-family: courier new; background: white; color: black; font-size: 8pt">   <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Collections.Generic;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Text;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Windows.Forms;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%">&#160; Autodesk.Revit .DB;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.UI;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit .ApplicationServices;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.Attributes ;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.UI.Selection;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; [</span><span style="line-height: 140%; color: #2b91af">TransactionAttribute</span><span style="line-height: 140%">(</span><span style="line-height: 140%; color: #2b91af">TransactionMode</span><span style="line-height: 140%">.Manual)]</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">RevitCommand</span><span style="line-height: 140%"> : </span><span style="line-height: 140%; color: #2b91af">IExternalCommand</span></p>    <p style="margin: 0px"><span style="line-height: 140%">{</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%"> Execute(</span><span style="line-height: 140%; color: #2b91af">ExternalCommandData</span><span style="line-height: 140%"> commandData, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">ref</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%"> messages, </span><span style="line-height: 140%; color: #2b91af">ElementSet</span><span style="line-height: 140%"> elements)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">UIApplication</span><span style="line-height: 140%"> app = commandData.Application;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Document</span><span style="line-height: 140%"> doc = app.ActiveUIDocument.Document;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Selection</span><span style="line-height: 140%"> sel = app.ActiveUIDocument.Selection;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Reference</span><span style="line-height: 140%"> ref1 = sel.PickObject(</span><span style="line-height: 140%; color: #2b91af">ObjectType</span><span style="line-height: 140%">.Element, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot;pick a family instance&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">FamilyInstance</span><span style="line-height: 140%"> inst = doc.GetElement(ref1) </span><span style="line-height: 140%; color: blue">as</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">FamilyInstance</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%">(inst == </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; messages = </span><span style="line-height: 140%; color: #a31515">&quot;No family instance was picked&quot;</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%">.Failed;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">FamilySymbol</span><span style="line-height: 140%"> sym = inst.Symbol;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Document</span><span style="line-height: 140%"> targetDoc = </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">foreach</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">Document</span><span style="line-height: 140%"> doc1 </span><span style="line-height: 140%; color: blue">in</span><span style="line-height: 140%"> app.Application.Documents)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (doc.Title != doc1.Title)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetDoc = doc1;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">break</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">IList</span><span style="line-height: 140%">&lt;</span><span style="line-height: 140%; color: #2b91af">ElementId</span><span style="line-height: 140%">&gt; ids = </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">List</span><span style="line-height: 140%">&lt;</span><span style="line-height: 140%; color: #2b91af">ElementId</span><span style="line-height: 140%">&gt;();</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">foreach</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">FamilySymbol</span><span style="line-height: 140%"> symbol </span><span style="line-height: 140%; color: blue">in</span><span style="line-height: 140%"> sym.Family.Symbols)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; ids.Add(symbol.Id);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Transaction</span><span style="line-height: 140%"> targetTrans = </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Transaction</span><span style="line-height: 140%">(targetDoc);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; targetTrans.Start(</span><span style="line-height: 140%; color: #a31515">&quot;copyFamily&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">ElementTransformUtils</span><span style="line-height: 140%">.CopyElements(doc, ids, targetDoc, </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">CopyPasteOptions</span><span style="line-height: 140%">());</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; targetTrans.Commit();</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%">.Succeeded ;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">}</span></p> </div><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/6Ezo7PfGCh8" height="1" width="1"/>]]></content:encoded>



<dc:creator>Joe Ye</dc:creator>
<pubDate>Fri, 31 May 2013 00:14:31 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/copy-family-between-documents-via-api.html</feedburner:origLink></item>
<item>
<title>Webinar announcement</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/fhQ12JR6Tj8/webinar-announcement.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/webinar-announcement.html</guid>
<description>By Stephen Preston Register and mark your calendars now for this upcoming webcast on making the most of the Autodesk Exchange Apps store ... "How developers can ride and profit from the adoption wave of Autodesk Exchange Apps" The Autodesk Exchange Apps stores (currently there are 15 stores) are a...</description>
<content:encoded><![CDATA[<p>By<a href="http://adndevblog.typepad.com/autocad/stephen-preston.html"> Stephen Preston</a></p>
<p>Register and mark your calendars now for this upcoming webcast on making the most of the Autodesk Exchange Apps store ...</p>
<p><strong>&quot;How developers can ride and profit
from the adoption wave of Autodesk Exchange Apps&quot;</strong></p>
<p>The
Autodesk Exchange Apps stores (currently there are 15 stores) are a huge
opportunity for developers to gain direct access to the growing number of
Autodesk customers using Exchange Apps.&#0160;
In just one year there’s been over one million visits and over 250,000
downloads. With comments like “<em>one of my
most useful tools”, “love this app, saved me hours of work” </em>there’s no
doubt that Exchange Apps has become a resource that Autodesk<em> </em>customers rely on to find useful apps
of all types.&#0160; <em>&#0160;&#0160;</em></p>
<p>If you
develop apps and want to reach more customers quickly, easily and inexpensively
but haven’t yet put your toe in the water with Exchange Apps, the Autodesk
Developer Network (ADN) team is ready to help you.&#0160; You’re invited to attend a webinar on June 13<sup>th</sup>
hosted by Jim Quanci and Stephen Preston to learn how you can catch the wave
and accelerating growth of Exchange Apps.</p>
<p>You’ll
learn the tricks of the trade when publishing on Exchange Apps, get ideas on
how to be successful and learn about the ability to publish localized apps.
Here’s what you need to know:</p>
<p><strong>Webinar details:</strong></p>
<p>Date:
Thursday, June 13<sup>th</sup>, 2013<br />Time: 8
a.m. PDT (4 p.m. BST; 5 p.m. CET; 11 a.m. EDT)<br />Duration:
Approximately one hour</p>
<p>Open to
anyone interested in publishing apps on Autodesk Exchange Apps (i.e. ADN membership is not required :-).
</p>
<p><strong>Registration:</strong> Reserve your place by
June 11 by sending an email to <a href="mailto: adn-training-worldwide@autodesk.com?subject=Exchange_Apps_webinar">adn-training-worldwide@autodesk.com</a> with <em>Exchange Apps webinar</em> as the subject. Please
make sure you include your full name, company name and email address.
</p>
<em>And visit</em><em> <a href="http://www.autodesk.com/developapps">www.autodesk.com/developapps</a></em><em> now if you want a head start
in learning how to publish apps.</em><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/fhQ12JR6Tj8" height="1" width="1"/>]]></content:encoded>


<category>Announcements</category>
<category>Revit</category>
<category>Revit Architecture</category>
<category>Revit MEP</category>
<category>Revit Structure</category>
<category>Stephen Preston</category>

<dc:creator>Stephen Preston</dc:creator>
<pubDate>Wed, 29 May 2013 14:09:55 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/webinar-announcement.html</feedburner:origLink></item>
<item>
<title>API Wishlist Survey for Revit</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/6EH5dXydZPs/api-wishlist-survey-for-revit.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/api-wishlist-survey-for-revit.html</guid>
<description>Once again, the time for another round of API wishlist survey. This year's API wishlist survey is open for Revit from the link: Revit API Wishlist Survey 2013 Please take a moment to participate and complete this survey and let us hear your feedback. It will take less than 5...</description>
<content:encoded><![CDATA[<p>Once again, the time for another round of API wishlist survey. This year&#39;s API wishlist survey is open for Revit from the link: </p>
<p><a href="https://www.surveymonkey.com/s/RL8HDKF" target="_self" title="Revit API Wishlist Survey 2013 ">Revit API Wishlist Survey 2013 </a></p>
<p>Please take a moment to participate and complete this survey and let us hear your feedback. It will take less than 5 minutes to complete. Revit engineering team will use the results to understand your needs and&#0160;help prioritize the areas of API enhancements in future planning.&#0160;If you leave your e-mail address, we will send you the final result after it is concluded.&#0160;(e-mail address you leave will be&#0160;used solely for this purpose.&#0160;We do not share or use for any other purposes). &#0160;</p>
<p>The survey will open for three weeks till <strong>June 15th, 2013</strong>. We look forward to receiving your feedback! </p>
<p><a class="asset-img-link" href="http://adndevblog.typepad.com/.a/6a0167607c2431970b01901c90e92b970b-pi" style="display: inline;"><img alt="2013 0525 API wishlist Revit3" border="0" class="asset  asset-image at-xid-6a0167607c2431970b01901c90e92b970b" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b01901c90e92b970b-800wi" title="2013 0525 API wishlist Revit3" /></a></p><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/6EH5dXydZPs" height="1" width="1"/>]]></content:encoded>


<category>Announcements</category>
<category>Mikako Harada</category>
<category>Revit</category>

<dc:creator>Mikako Harada</dc:creator>
<pubDate>Sat, 25 May 2013 13:53:59 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/api-wishlist-survey-for-revit.html</feedburner:origLink></item>
<item>
<title>Navisworks 2014 API new feature - RenderPlugin</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/6e280_BMOf8/navisworks-2014-api-new-feature-renderplugin.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-renderplugin.html</guid>
<description>By Xiaodong Liang I have frequently heard the voice that the developers want to draw some custom graphics in Naivsworks e.g. the custom red line. Now it came true. The new plugin type provides methods to render user-graphics. It can render in 3D model space or 2D screen space. The...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/xiaodong-liang.html" target="_self">Xiaodong Liang</a></p>
<p>I have frequently heard the voice that the developers want to draw some custom graphics in Naivsworks e.g. the custom red line. Now it came true. The new plugin type provides methods to render user-graphics. It can render in 3D model space or 2D screen space. The new class <span style="color: #ff0080;">Graphics</span> is used to create the 2D/3D primitives. </p>
<p>Firstly, create a class deriving from RenderPlugin. It is a kind of implicit plugin which has no interface. So the attribute DisplayName is useless.</p>
<div style="font-family: courier new; background: white; color: black; font-size: 9pt;">
<p style="margin: 0px;"><span style="line-height: 140%;">[</span><span style="line-height: 140%; color: #2b91af;">Plugin</span><span style="line-height: 140%;">(</span><span style="line-height: 140%; color: #a31515;">&quot;RenderPluginTest&quot;</span><span style="line-height: 140%;">, </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #a31515;">&quot;ADSK&quot;</span><span style="line-height: 140%;">)]</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: blue;">public</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: blue;">class</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">RenderPluginTest</span><span style="line-height: 140%;"> : </span><span style="line-height: 140%; color: #2b91af;">RenderPlugin</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; {</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; }</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;</span></p>
<p style="margin: 0px;">&#0160;</p>
</div>
<p>Next, override the methods you want to use. </p>
<ul>
<li>public virtual void OverlayRenderModel(<a href="T_Autodesk_Navisworks_Api_View.htm">View</a> view,<a href="T_Autodesk_Navisworks_Api_Graphics.htm">Graphics</a> graphics) </li>
</ul>
<blockquote>
<p>This method renders the graphics in the overlay buffer.By default it’s set up for you to call graphics methods that take 3D model space coordinates. You can call graphics methods that take 2D model space coordinates from inside a BeginWindowContext-EndWindowContext block. </p>
</blockquote>
<ul>
<li>public virtual void OverlayRenderWindow(<a href="T_Autodesk_Navisworks_Api_View.htm">View</a> view,<a href="T_Autodesk_Navisworks_Api_Graphics.htm">Graphics</a> graphics) </li>
</ul>
<blockquote>
<p>This method renders the graphics in the overlay buffer. By default it’s set up for you to call graphics methods that take 2D window space coordinates. You can also call graphics methods that take 3D model space coordinates from inside a BeginModelContext-EndModelContext block </p>
</blockquote>
<ul>
<li>public virtual void RenderModel(<a href="T_Autodesk_Navisworks_Api_View.htm">View</a> view,<a href="T_Autodesk_Navisworks_Api_Graphics.htm">Graphics</a> graphics) </li>
</ul>
<blockquote>
<p>Similar to OverlayRenderModel, but renders in the main buffer. </p>
</blockquote>
<ul>
<li>public virtual void RenderWindow(<a href="T_Autodesk_Navisworks_Api_View.htm">View</a> view,<a href="T_Autodesk_Navisworks_Api_Graphics.htm">Graphics</a> graphics) </li>
</ul>
<blockquote>
<p>Similar to OverlayRenderWindow but renders in the main buffer.</p>
</blockquote>
<p>Where possible, it is recommended that you should be using Overlay*** to do ‘overly graphics’ rather than using ‘Render***’. </p>
<p>The code below draws a triangle and two lines. </p>
<div style="font-family: courier new; background: white; color: black; font-size: 9pt;">
<p style="margin: 0px;"><span style="line-height: 140%; color: blue;">public</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: blue;">override</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: blue;">void</span><span style="line-height: 140%;"> OverlayRenderWindow(</span><span style="line-height: 140%; color: #2b91af;">View</span><span style="line-height: 140%;"> view,</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Graphics</span><span style="line-height: 140%;"> graphics)</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">{&#0160;&#0160; </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// the color for the graphics</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;"> colorRed = </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;">.FromByteRGB(255, 0, 0);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// color and alpha value </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Color(colorRed, 0.7);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">//set line width</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.LineWidth(5);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p1 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(20, 20);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p2 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(view.Width - 20, 20);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p3 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(view.Width /2.0, view.Height - 20);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// draw triangle, fill in it</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Triangle(p1,p2,p3,</span><span style="line-height: 140%; color: blue;">true</span><span style="line-height: 140%;">);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// the color for the graphics</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;"> colorGreen = </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;">.FromByteRGB(0, 255, 0);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// color and alpha value </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Color(colorGreen, 0.7);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p4 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(20, 20);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p5 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(view.Width / 2.0, (view.Height - 20) / 2.0);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;"> p6 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point2D</span><span style="line-height: 140%;">(view.Width - 20, 20);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">//draw two lines</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Line(p4, p5);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Line(p5, p6);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">} </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;</span></p>
</div>
Since the 2D is in window space coordinates, the graphics will update with the view size changing.
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;">&#0160;<a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b0191026643cc970c-pi"><img alt="image" border="0" height="247" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aa2eb245970d-pi" style="display: inline; border-width: 0px;" title="image" width="294" /></a> </p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aa2eb25c970d-pi"><img alt="image" border="0" height="122" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aa2eb26c970d-pi" style="display: inline; border-width: 0px;" title="image" width="295" /></a></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;">The code below draws a cylinder. </p>
<div style="font-family: courier new; background: white; color: black; font-size: 9pt;">
<div style="font-family: courier new; background: white; color: black; font-size: 9pt;">
<p style="margin: 0px;"><span style="line-height: 140%; color: blue;">public</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: blue;">override</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: blue;">void</span><span style="line-height: 140%;"> OverlayRenderModel(</span><span style="line-height: 140%; color: #2b91af;">View</span><span style="line-height: 140%;"> view, </span><span style="line-height: 140%; color: #2b91af;">Graphics</span><span style="line-height: 140%;"> graphics)</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">{ </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// the color for the graphics</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;"> colorBlue = </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;">.FromByteRGB(0, 0, 255);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// color and alpha value </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Color(colorBlue, 1); </span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;"> p1 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;">(0, 0,0);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;"> p2 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;">(0, 0,10);&#0160;&#0160;&#0160;&#0160; </span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// draw Cylinder </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Cylinder(p1,p2,10);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// the color for the graphics</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;"> colorGrey = </span><span style="line-height: 140%; color: #2b91af;">Color</span><span style="line-height: 140%;">.FromByteRGB(128, 128, 128);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// color and alpha value </span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Color(colorGrey, 1);</span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;"> p3 = </span><span style="line-height: 140%; color: blue;">new</span><span style="line-height: 140%;"> </span><span style="line-height: 140%; color: #2b91af;">Point3D</span><span style="line-height: 140%;">(20, 20,0);&#0160;&#0160;&#0160;&#0160; </span></p>
<p style="margin: 0px;">&#0160;</p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; </span><span style="line-height: 140%; color: green;">// draw sphere</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">&#0160;&#0160;&#0160; graphics.Sphere(p3, 10);</span></p>
<p style="margin: 0px;"><span style="line-height: 140%;">} </span></p>
</div>
<p style="margin: 0px;"><a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b01901c705ea4970b-pi"><img alt="image" border="0" height="215" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b019102664414970c-pi" style="display: inline; border: 0px;" title="image" width="356" /></a> </p>
</div><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/6e280_BMOf8" height="1" width="1"/>]]></content:encoded>


<category>.NET</category>
<category>Navisworks</category>
<category>Xiaodong Liang</category>

<dc:creator>Xiaodong Liang</dc:creator>
<pubDate>Thu, 23 May 2013 22:36:00 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-renderplugin.html</feedburner:origLink></item>
<item>
<title>Create stirrup rebar by given model curves via Revit API</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/8OmX0crRvIQ/create-stirrup-rebar-by-given-model-curves-via-revit-api.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/create-stirrup-rebar-by-given-model-curves-via-revit-api.html</guid>
<description>By Joe Ye As creating a stirrup rebar shape family is not so easy. Users would like to sketch up the shape of the stirrup within a column. This article introduce how to create a stirrup by several model curves within a column. using System; using System.Collections.Generic; using System.Linq; using...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/joe-ye.html">Joe Ye</a></p>  <p>As creating a stirrup rebar shape family is not so easy. Users would like to sketch up the shape of the stirrup within a column. This article introduce how to create a stirrup by several model curves within a column.</p>  <p>&#160;</p>  <div style="font-family: courier new; background: white; color: black; font-size: 8pt">   <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Collections.Generic;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Linq;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> System.Text;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.ApplicationServices;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.UI;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.DB.Structure;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.DB;</span></p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">using</span><span style="line-height: 140%"> Autodesk.Revit.UI.Selection;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%; color: blue">namespace</span><span style="line-height: 140%"> MyCreateRebar</span></p>    <p style="margin: 0px"><span style="line-height: 140%">{</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; [Autodesk.Revit.Attributes.</span><span style="line-height: 140%; color: #2b91af">Transaction</span><span style="line-height: 140%">(Autodesk.Revit.Attributes.</span><span style="line-height: 140%; color: #2b91af">TransactionMode</span><span style="line-height: 140%">.Manual)]</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; [Autodesk.Revit.Attributes.</span><span style="line-height: 140%; color: #2b91af">Regeneration</span><span style="line-height: 140%">(Autodesk.Revit.Attributes.</span><span style="line-height: 140%; color: #2b91af">RegenerationOption</span><span style="line-height: 140%">.Manual)]</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Command1</span><span style="line-height: 140%"> : </span><span style="line-height: 140%; color: #2b91af">IExternalCommand</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%"> Execute(</span><span style="line-height: 140%; color: #2b91af">ExternalCommandData</span><span style="line-height: 140%"> commandData, </span><span style="line-height: 140%; color: blue">ref</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%"> message, </span><span style="line-height: 140%; color: #2b91af">ElementSet</span><span style="line-height: 140%"> elements)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">UIApplication</span><span style="line-height: 140%"> uiApp = commandData.Application;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Selection</span><span style="line-height: 140%"> sel = uiApp.ActiveUIDocument.Selection;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%"> app = uiApp.Application;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Document</span><span style="line-height: 140%"> doc = uiApp.ActiveUIDocument.Document;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarBarType</span><span style="line-height: 140%"> barType = </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarHookType</span><span style="line-height: 140%"> hookType = </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Transaction</span><span style="line-height: 140%"> transaction = </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Transaction</span><span style="line-height: 140%">(doc, </span><span style="line-height: 140%; color: #a31515">&quot;CreateRebar Tool&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">try</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; transaction.Start();</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">IList</span><span style="line-height: 140%">&lt;</span><span style="line-height: 140%; color: #2b91af">Curve</span><span style="line-height: 140%">&gt; curves1 = </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">List</span><span style="line-height: 140%">&lt;</span><span style="line-height: 140%; color: #2b91af">Curve</span><span style="line-height: 140%">&gt;();</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">ElementSet</span><span style="line-height: 140%"> eleset = sel.Elements;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">foreach</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">Element</span><span style="line-height: 140%"> e </span><span style="line-height: 140%; color: blue">in</span><span style="line-height: 140%"> eleset)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (e </span><span style="line-height: 140%; color: blue">is</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">ModelLine</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Line</span><span style="line-height: 140%"> l = (e </span><span style="line-height: 140%; color: blue">as</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">ModelLine</span><span style="line-height: 140%">).GeometryCurve </span><span style="line-height: 140%; color: blue">as</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Line</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Line</span><span style="line-height: 140%"> line = app.Create.NewLineBound(l.get_EndPoint(0), l.get_EndPoint(1));</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; curves1.Add(line);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">foreach</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">RebarBarType</span><span style="line-height: 140%"> bt </span><span style="line-height: 140%; color: blue">in</span><span style="line-height: 140%"> doc.RebarBarTypes)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; barType = bt;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">break</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">foreach</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">RebarHookType</span><span style="line-height: 140%"> ht </span><span style="line-height: 140%; color: blue">in</span><span style="line-height: 140%"> doc.RebarHookTypes)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; hookType = ht;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Reference</span><span style="line-height: 140%"> hasPickOne = sel.PickObject(</span><span style="line-height: 140%; color: #2b91af">ObjectType</span><span style="line-height: 140%">.Element);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">FamilyInstance</span><span style="line-height: 140%"> hostFi = doc.get_Element(hasPickOne.ElementId) </span><span style="line-height: 140%; color: blue">as</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">FamilyInstance</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Rebar</span><span style="line-height: 140%"> rebar = CreateRebar1(uidoc, curves1, hostFi, barType, hookType);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">catch</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">Exception</span><span style="line-height: 140%"> ex)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; message += ex.Message;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> Autodesk.Revit.UI.</span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%">.Failed;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">finally</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; transaction.Commit();</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">Result</span><span style="line-height: 140%">.Succeeded;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Rebar</span><span style="line-height: 140%"> CreateRebar1(</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Autodesk.Revit.UI.</span><span style="line-height: 140%; color: #2b91af">UIDocument</span><span style="line-height: 140%"> uidoc,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">IList</span><span style="line-height: 140%">&lt;</span><span style="line-height: 140%; color: #2b91af">Curve</span><span style="line-height: 140%">&gt; curves,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">FamilyInstance</span><span style="line-height: 140%"> column,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarBarType</span><span style="line-height: 140%"> barType,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarHookType</span><span style="line-height: 140%"> hookType)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; {</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">LocationPoint</span><span style="line-height: 140%"> location = column.Location </span><span style="line-height: 140%; color: blue">as</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">LocationPoint</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">XYZ</span><span style="line-height: 140%"> origin = location.Point;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Rebar</span><span style="line-height: 140%"> rebar = </span><span style="line-height: 140%; color: #2b91af">Rebar</span><span style="line-height: 140%">.CreateFromCurves(uidoc.Document, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarStyle</span><span style="line-height: 140%">.StirrupTie, barType, hookType, hookType,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; column, </span><span style="line-height: 140%; color: blue">new</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">XYZ</span><span style="line-height: 140%">(0, 0, 1), curves, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">RebarHookOrientation</span><span style="line-height: 140%">.Left, </span><span style="line-height: 140%; color: #2b91af">RebarHookOrientation</span><span style="line-height: 140%">.Left, </span><span style="line-height: 140%; color: blue">true</span><span style="line-height: 140%">, </span><span style="line-height: 140%; color: blue">true</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> rebar;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160; }</span></p>    <p style="margin: 0px"></p> </div><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/8OmX0crRvIQ" height="1" width="1"/>]]></content:encoded>



<dc:creator>Joe Ye</dc:creator>
<pubDate>Thu, 23 May 2013 03:47:04 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/create-stirrup-rebar-by-given-model-curves-via-revit-api.html</feedburner:origLink></item>
<item>
<title>Navisworks 2014 API new feature &amp;ndash; Dynamic Loading of Plugin</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/JOUO6cuAAI0/navisworks-2014-api-new-feature-dynamic-loading-of-plugin.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-dynamic-loading-of-plugin.html</guid>
<description>By Xiaodong Liang In the past, Navisworks will load all valid plugins in the folder &lt;Naivsworks&gt;\Plugins. Of course, as indicated in Navisworks 2014 API new feature – One more path to load plugin, Navisworks will also load the plugins in the new folder automatically as well. In some situations, we...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/xiaodong-liang.html" target="_self">Xiaodong Liang</a></p>  <p>In the past, Navisworks will load all valid plugins in the folder &lt;Naivsworks&gt;\Plugins. Of course, as indicated in <a href="http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-one-more-path-to-load-plugin.html">Navisworks 2014 API new feature – One more path to load plugin</a>, Navisworks will also load the plugins in the new folder automatically as well.</p>  <p>In some situations, we may need to demand loading the plugin when necessary. 2014 provides such mechanism. </p>  <p>ApplicationParts.ApplicationPlugins.AddPluginAssembly(<em>absolute path name of the plugin</em>)</p>  <p>Following is a small experiment. It self explains the usage which is very straightforward. </p>  <p>1. create a simple AddinPlugin and put the binary to any folder such as c:\temp</p>  <div style="font-family: courier new; background: white; color: black; font-size: 9pt">   <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; [</span><span style="line-height: 140%; color: #2b91af">PluginAttribute</span><span style="line-height: 140%">(</span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn_LoadTest&quot;</span><span style="line-height: 140%">,       <br /></span><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot;ADSK&quot;</span><span style="line-height: 140%">,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%">DisplayName = </span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn_LoadTest&quot;</span><span style="line-height: 140%">)]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">BasicPlugIn_LoadTest</span><span style="line-height: 140%"> :       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">AddInPlugin</span><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">override</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">int</span><span style="line-height: 140%"> Execute(</span><span style="line-height: 140%; color: blue">params</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%">[] parameters)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">MessageBox</span><span style="line-height: 140%">.Show(</span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn_LoadTest is executed!&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> 0;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; } </span></p> </div>  <p><a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b01910253876e970c-pi"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aa1be8e8970d-pi" width="289" height="125" /></a> </p>  <p>&#160;</p>  <p>2. create a plugin which is put in the two folders where Navisworks will load the plugin automatically. e.g. &lt;Naivsworks&gt;\Plugins</p>  <p>&#160; </p>  <p></p>  <p></p>  <div style="font-family: courier new; background: white; color: black; font-size: 9pt">   <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; [</span><span style="line-height: 140%; color: #2b91af">PluginAttribute</span><span style="line-height: 140%">(</span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn&quot;</span><span style="line-height: 140%">,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot;ADSK&quot;</span><span style="line-height: 140%">,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ToolTip = </span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn tool tip&quot;</span><span style="line-height: 140%">, </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DisplayName = </span><span style="line-height: 140%; color: #a31515">&quot;Hello World Plugin&quot;</span><span style="line-height: 140%">)]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">class</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: #2b91af">ABasicPlugin</span><span style="line-height: 140%"> : </span><span style="line-height: 140%; color: #2b91af">AddInPlugin</span><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">public</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">override</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">int</span><span style="line-height: 140%"> Execute(</span><span style="line-height: 140%; color: blue">params</span><span style="line-height: 140%"> </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%">[] parameters)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; {&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//the name of the plugin which is to be loaded dynamically</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%"> plugin_name_to_load = </span><span style="line-height: 140%; color: #a31515">&quot;BasicPlugIn_LoadTest.ADSK&quot;</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// plugin record</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">PluginRecord</span><span style="line-height: 140%"> dotest = </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">try</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dotest = Autodesk.Navisworks.Api.</span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.Plugins.       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FindPlugin(plugin_name_to_load);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (dotest != </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// the plugin has been loaded. exit.</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">MessageBox</span><span style="line-height: 140%">.Show(</span><span style="line-height: 140%; color: #a31515">&quot;the plugin &quot;</span><span style="line-height: 140%"> +        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; plugin_name_to_load +        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot; has been loaded!&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> 0;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">else</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// load the plugin assembly</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Autodesk.Navisworks.Api.</span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.Plugins.AddPluginAssembly(       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">@&quot;C:\temp\BasicPlugIn_LoadTest.ADSK.dll&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// get the plugin record. </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">PluginRecord</span><span style="line-height: 140%"> otherpluginrecord =</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Autodesk.Navisworks.Api.</span><span style="line-height: 140%; color: #2b91af">Application</span><span style="line-height: 140%">.Plugins.       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FindPlugin(plugin_name_to_load);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (otherpluginrecord != </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//loaded&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">if</span><span style="line-height: 140%"> (!otherpluginrecord.IsLoaded)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//load the plugin</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; otherpluginrecord.LoadPlugin();</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">MessageBox</span><span style="line-height: 140%">.Show(</span><span style="line-height: 140%; color: #a31515">&quot;the plugin &quot;</span><span style="line-height: 140%"> + </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; plugin_name_to_load + </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot; has been loaded by AddPluginAssembly!&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//get the plugin of the record</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">Plugin</span><span style="line-height: 140%"> otherplugin =        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; otherpluginrecord.LoadedPlugin;</span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//call one method of the plugin</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//since we do not know the type of the other plugin,</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">//use InvokeMember</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">string</span><span style="line-height: 140%">[] pa = { </span><span style="line-height: 140%; color: #a31515">&quot;dummy&quot;</span><span style="line-height: 140%">};</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; otherplugin.GetType().InvokeMember(</span><span style="line-height: 140%; color: #a31515">&quot;Execute&quot;</span><span style="line-height: 140%">,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%">System.Reflection.</span><span style="line-height: 140%; color: #2b91af">BindingFlags</span><span style="line-height: 140%">.InvokeMethod,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">null</span><span style="line-height: 140%">, otherplugin,</span><span style="line-height: 140%">pa);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p>    <p style="margin: 0px">&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">else</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// any other problems</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #2b91af">MessageBox</span><span style="line-height: 140%">.Show(       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot;Navisworks has tried to load the plugin &quot;</span><span style="line-height: 140%"> + </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; plugin_name_to_load + </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: #a31515">&quot; but it is still null. Please check the path name!&quot;</span><span style="line-height: 140%">);</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">catch</span><span style="line-height: 140%"> (</span><span style="line-height: 140%; color: #2b91af">Exception</span><span style="line-height: 140%"> ex)</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: green">// any exception</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Diagnostics.</span><span style="line-height: 140%; color: #2b91af">Debug</span><span style="line-height: 140%">.Write(ex.ToString());</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="line-height: 140%; color: blue">return</span><span style="line-height: 140%"> 0;</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160;&#160;&#160;&#160; }</span></p>    <p style="margin: 0px"><span style="line-height: 140%">&#160;&#160; } </span></p> </div>  <p></p> <a href="http://adndevblog.typepad.com/.a/6a0167607c2431970b0192aa1be902970d-pi"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b01901c5d84f3970b-pi" width="347" height="110" /></a>   <p>When you click the button of BasicPlugIn, it will try to load the other plugin BasicPlugIn_LoadTest.ADSK and call its method Execute. From this experiment, you could also find the binary dll of other plugin could be within any folder.&#160; It would be a convenience for you to deploy your application.</p><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/JOUO6cuAAI0" height="1" width="1"/>]]></content:encoded>


<category>.NET</category>
<category>Navisworks</category>
<category>Xiaodong Liang</category>

<dc:creator>Xiaodong Liang</dc:creator>
<pubDate>Sun, 19 May 2013 20:43:49 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-dynamic-loading-of-plugin.html</feedburner:origLink></item>
<item>
<title>A New Glue, New Look, and 30-day Free Trial!</title>
<link>http://feedproxy.google.com/~r/AecDevblog/~3/Wj06kMqQhZk/a-new-glue-new-look-and-30-day-free-trial.html</link>
<guid isPermaLink="false">http://adndevblog.typepad.com/aec/2013/05/a-new-glue-new-look-and-30-day-free-trial.html</guid>
<description>By Mikako Harada We are excited to let you know that a major new release of Autodesk® BIM 360™ Glue® is available now: http://www.autodesk.com/bim360glue BIM 360 Glue (the Glue) is a cloud-based, BIM Management solution that facilitates multidiscipline model coordination and collaboration. It provides all project members with access to...</description>
<content:encoded><![CDATA[<p>By <a href="http://adndevblog.typepad.com/aec/mikako-harada.html" target="_self" title="Mikako Harada">Mikako Harada</a></p>
<p>We are excited to let you know that a major new release of Autodesk® BIM 360™ Glue® is available now:</p>
<p>&#0160;&#0160;&#0160; <a href="http://www.autodesk.com/bim360glue">http://www.autodesk.com/bim360glue</a> </p>
<p><a class="asset-img-link" href="http://adndevblog.typepad.com/.a/6a0167607c2431970b017eeb4f8378970d-pi" style="display: inline;"><img alt="BIM 360 Glue Image3" border="0" class="asset  asset-image at-xid-6a0167607c2431970b017eeb4f8378970d image-full" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b017eeb4f8378970d-800wi" title="BIM 360 Glue Image3" /></a></p>
<p>BIM 360 Glue (the Glue) is a cloud-based, BIM Management solution that facilitates multidiscipline model coordination and collaboration. It provides all project members with access to the most up-to-date project models and data from anywhere anytime. You can upload models from Autodesk Navisworks®, Revit®, AutoCAD® and Civil 3D®, and literally “glue” them together up in the cloud. Now with the new UI, it will be more intuitive for you to use. For more detail, please&#0160;refere to&#0160;the&#0160;<a href="http://www.autodesk.com/bim360glue%20" target="_self" title="BIM 360 Glue">BIM 360 Glue product page</a>. &#0160;</p>
<p><a class="asset-img-link" href="http://adndevblog.typepad.com/.a/6a0167607c2431970b019102480d70970c-pi" style="display: inline;"><img alt="GlueSampleModel" border="0" class="asset  asset-image at-xid-6a0167607c2431970b019102480d70970c image-full" src="http://adndevblog.typepad.com/.a/6a0167607c2431970b019102480d70970c-800wi" title="GlueSampleModel" /></a></p>
<p>If you haven’t had a chance to try it, now is the chance; there is 30-day free trial version available for you to try it. Please follow the link below, and simply sign up:</p>
<p>&#0160;&#0160; &#0160;<a href="http://www.autodesk.com/bim360gluetrial">www.autodesk.com/bim360gluetrial</a></p>
<p>I must also add; if you haven’t tried iPad app, please make sure you try “Immersive View”, too. &#0160;The walk through experience using iPad app is just a different user experience that you must know. </p>
<p><em><strong>Note:</strong> Access to the Glue platform through the API, or a development environment, is not a part of this product trial environment at this stage. In order to use the API, you will first need to a member of ADN (ADN Professional or Standard) and need to be a part of a Glue API ADN pilot program. Autodesk is actively working on a way to widen the accessibility. In a mean time, if you are interested developing a cloud and mobile solution using the Glue API, please contact ADN: <a href="http://www.autodesk.com/joinadn">www.autodesk.com/joinadn</a></em></p>
<p><em>&#0160;</em></p><img src="http://feeds.feedburner.com/~r/AecDevblog/~4/Wj06kMqQhZk" height="1" width="1"/>]]></content:encoded>


<category>Announcements</category>
<category>Cloud</category>
<category>Mikako Harada</category>

<dc:creator>Mikako Harada</dc:creator>
<pubDate>Sat, 18 May 2013 12:38:58 -0700</pubDate>

<feedburner:origLink>http://adndevblog.typepad.com/aec/2013/05/a-new-glue-new-look-and-30-day-free-trial.html</feedburner:origLink></item>

</channel>
</rss><!-- ph=1 -->
