That's exactly what I needed. Thank you Dino.<br><br><div><span class="gmail_quote">On 8/10/06, <b class="gmail_sendername">Dino Viehland</b> &lt;<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>
&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">You can get the assembly object from an AutoCAD type:
typeof(Foo).Assembly.&nbsp; From there you just need to have one helper which
will register this in the engine, so you could do:</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">delegate void AddReference(object assembly);</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">AddReference adr = engine.CreateMethod&lt;AddReference&gt;("clr.AddReference(assembly)");</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">adr.AddReference(typeof(SomeAutoCadType).Assembly);</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">and then from there you should be able to import any of the AutoCAD
namespaces from any of your modules.&nbsp; </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 9pt;">From:</span></b><span style="font-size: 9pt;"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com
</a>
[mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Tim Riley<br>
<b>Sent:</b> Thursday, August 10, 2006 11:40 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Embedding Question</span></p>

</div></div><div><span class="e" id="q_10cf9798ee37edd4_1">

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">What I'm trying to do is sort
of weird so let me see if I can elaborate further. I am embedding IronPython in
a .NET assembly that will later be loaded into AutoCAD. AutoCAD has their own
two .NET assemblies that must be referenced, &quot; acmgd.dll&quot; and
&quot;acdbmgd.dll&quot;. These two assemblies are always loaded while AutoCAD
is running so their location isn't really a concern when creating a C# .dll.
However when I want to modify AutoCAD entities from within my IP scripts I must
first load the assemblies from file and path which is a problem because the
file and path are different with each different version of AutoCAD. <br>
<br>
For example their path in my AutoCAD Mechanical 2005 is 'C:\Program
Files\Autodesk\Acadm 2005' but with regular AutoCAD it would be 'C:\Program
Files\Autodesk\Acad 2005'. There are so many different variations that this
path could be that it would be a big deal to try/except load them all from some
sort of init script. <br>
<br>
So basically I'm looking to pass a non-GAC assembly reference from my C#
project to my IP project.<br>
<br>
<br>
Note: I'm fine with the import statements.</p>

<div>

<p><span>On 8/10/06, <b>Dino Viehland</b> &lt;<a href="mailto:dinov@exchange.microsoft.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dinov@exchange.microsoft.com</a>&gt;
wrote:</span></p>

<div>

<div>

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Adding references updates the
entire engine, it's not local to just the current module.&nbsp; So once you
have added a reference you just need to import the namespace into any given
module.&nbsp; </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Were you also trying to avoid
the import statements?</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 9pt;">From:</span></b><span style="font-size: 9pt;"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com
</a>
[mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Tim Riley<br>
<b>Sent:</b> Thursday, August 10, 2006 11:02 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> [IronPython] Embedding Question</span></p>

</div>

</div>

<div>

<p>&nbsp;</p>

<p>If I have an embedded project can I automatically make .NET assemblies
referenced in the project available to my python scripts? For example I have
two assemblies(not in the GAC) that I have referenced in my project. I would
like them always available to all python files run from this program without
having to do the import clr, clr.AddReferenceToFileAndPath('blah') stuff in the
beginning of each file. Is this possible?<br>
<br>
<br>
Regards,<br>
Tim Riley</p>

</div>

</div>

</div>

<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
</p>

</div>

<p>&nbsp;</p>

</span></div><div></div>

</div>



</div><br>_______________________________________________<br>users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br><br><br></blockquote></div><br>