<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic using COM API in .net dll in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334401#M84973</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to use the COM API in my .net dll (acad 2005) with C#&lt;BR /&gt;
I can get the code to work in VB.net but not C#&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
to get the hosting acad application&lt;BR /&gt;
&lt;BR /&gt;
'in vba &lt;BR /&gt;
  Public WithEvents m_Acad As AcadApplication&lt;BR /&gt;
  Set m_Acad = AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
'in vb.net dll&lt;BR /&gt;
  Dim _AcadApp As Autodesk.AutoCAD.Interop.AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
in c#.net dll&lt;BR /&gt;
//Yet converting the vb.net code to C#&lt;BR /&gt;
//Build gives error CS0029 cannot convert object to Autodesk.AutoCAD.Interop.AcadApplication &lt;BR /&gt;
  private Autodesk.AutoCAD.Interop.AcadApplication _AcadApp =  Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I assume the vb.net code is converting the '.net acad object' to the 'com acad object'&lt;BR /&gt;
I want to avoid using GetActiveObject("AutoCAD.Application.16")&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Mark</description>
    <pubDate>Tue, 24 May 2005 02:18:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-05-24T02:18:53Z</dc:date>
    <item>
      <title>using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334401#M84973</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to use the COM API in my .net dll (acad 2005) with C#&lt;BR /&gt;
I can get the code to work in VB.net but not C#&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
to get the hosting acad application&lt;BR /&gt;
&lt;BR /&gt;
'in vba &lt;BR /&gt;
  Public WithEvents m_Acad As AcadApplication&lt;BR /&gt;
  Set m_Acad = AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
'in vb.net dll&lt;BR /&gt;
  Dim _AcadApp As Autodesk.AutoCAD.Interop.AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
in c#.net dll&lt;BR /&gt;
//Yet converting the vb.net code to C#&lt;BR /&gt;
//Build gives error CS0029 cannot convert object to Autodesk.AutoCAD.Interop.AcadApplication &lt;BR /&gt;
  private Autodesk.AutoCAD.Interop.AcadApplication _AcadApp =  Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I assume the vb.net code is converting the '.net acad object' to the 'com acad object'&lt;BR /&gt;
I want to avoid using GetActiveObject("AutoCAD.Application.16")&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Mark</description>
      <pubDate>Tue, 24 May 2005 02:18:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334401#M84973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T02:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334402#M84974</link>
      <description>I'm sure there are lots of opinions and methods, but you should use the&lt;BR /&gt;
specific application ID which for 2005 is "16.1". Also learn to use the&lt;BR /&gt;
imports/using statements so you have less typing &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;BR /&gt;
&lt;BR /&gt;
VB.NET&lt;BR /&gt;
Imports System.Windows.Forms&lt;BR /&gt;
Imports System.Runtime.InteropServices&lt;BR /&gt;
Imports Autodesk.AutoCAD.Interop&lt;BR /&gt;
Imports Autodesk.AutoCAD.Interop.Common&lt;BR /&gt;
&lt;BR /&gt;
Public Function Connect2Acad() As Boolean&lt;BR /&gt;
	'+-- Retrieve or establish reference to AutoCAD [via COM]&lt;BR /&gt;
	' test to see if reference is already established&lt;BR /&gt;
	If IsNothing(cadApp) Then&lt;BR /&gt;
		' no so try accessing existing session&lt;BR /&gt;
		Try&lt;BR /&gt;
			cadApp = Marshal.GetActiveObject("AutoCAD.Application.16.2")&lt;BR /&gt;
		Catch&lt;BR /&gt;
			' existing session not found...fire up Acad&lt;BR /&gt;
			Try&lt;BR /&gt;
				cadApp = CreateObject("AutoCAD.Application.16.2")&lt;BR /&gt;
			Catch AcadEx As Autodesk.AutoCAD.Runtime.Exception&lt;BR /&gt;
				Dim sMsg As String = AcadEx.Message &amp;amp; " from: " &amp;amp; AcadEx.Source&lt;BR /&gt;
				MessageBox.Show(sMsg, "AutoCAD_BasicCalls|Connect2Acad",&lt;BR /&gt;
MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;BR /&gt;
				Return False&lt;BR /&gt;
			End Try&lt;BR /&gt;
		End Try&lt;BR /&gt;
	End If&lt;BR /&gt;
	' made it here so it worked&lt;BR /&gt;
	Return True&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
C# &lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Runtime.InteropServices; &lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
using Autodesk.AutoCAD.Interop; &lt;BR /&gt;
using Autodesk.AutoCAD.Interop.Common; &lt;BR /&gt;
&lt;BR /&gt;
class HitAcad_example &lt;BR /&gt;
{ &lt;BR /&gt;
 public AcadApplication cadApp; &lt;BR /&gt;
 public AcadDocument cadDoc; &lt;BR /&gt;
 &lt;BR /&gt;
 public bool Connect2Acad() &lt;BR /&gt;
 { &lt;BR /&gt;
     try { &lt;BR /&gt;
       cadApp =(Autodesk.AutoCAD.Interop.AcadApplication)&lt;BR /&gt;
Marshal.GetActiveObject("AutoCAD.Application.16.1"); &lt;BR /&gt;
     } catch { &lt;BR /&gt;
         try { &lt;BR /&gt;
           cadApp =new Autodesk.AutoCAD.Interop.AcadApplication(); &lt;BR /&gt;
           cadApp.Visible = true; &lt;BR /&gt;
         } catch (System.Exception AcadEx) { &lt;BR /&gt;
           string sMsg = AcadEx.Message + " from: " + AcadEx.Source; &lt;BR /&gt;
           MessageBox.Show(sMsg, "AutoCAD_BasicCalls|Connect2Acad",&lt;BR /&gt;
MessageBoxButtons.OK, MessageBoxIcon.Error); &lt;BR /&gt;
           return false; &lt;BR /&gt;
         } &lt;BR /&gt;
     } &lt;BR /&gt;
    return true; &lt;BR /&gt;
 } &lt;BR /&gt;
}&lt;BR /&gt;
 &lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...</description>
      <pubDate>Tue, 24 May 2005 04:16:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334402#M84974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T04:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334403#M84975</link>
      <description>ks Mike&lt;BR /&gt;
&lt;BR /&gt;
I do use 'Imports' or 'using' but sometimes you need the fully qualified name to prevent ambiguity (ie application is in more than one of your imports)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
//c#   I was missing the (AcadApplication)&lt;BR /&gt;
Autodesk.AutoCAD.Interop.AcadApplication   _AcadApp = (AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
&lt;BR /&gt;
I didn't want to use GetActiveObject is this can return any running instance of acad and not necessarly the one my .net dll is loaded into.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Mark</description>
      <pubDate>Tue, 24 May 2005 05:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334403#M84975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T05:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334404#M84976</link>
      <description>&amp;gt; I do use 'Imports' or 'using' but sometimes you need the fully qualified name to prevent ambiguity (ie application is in more than one of your imports)&lt;BR /&gt;
Haven't had that problem&lt;BR /&gt;
 &lt;BR /&gt;
&amp;gt; I didn't want to use GetActiveObject is this can return any running instance of acad and not necessarly the one my .net dll is loaded into.&lt;BR /&gt;
Well you can't create a new instance from a dll already running in AutoCAD!&lt;BR /&gt;
Sorry I misread that portion of your post. You either need to use&lt;BR /&gt;
GetActiveObject or a bit of managed code to get the host something like:&lt;BR /&gt;
&lt;BR /&gt;
Imports AcadApp = Autodesk.AutoCAD.ApplicationServices.Application&lt;BR /&gt;
&lt;BR /&gt;
Public Shared m_CoAcadApp As Autodesk.AutoCAD.Interop.AcadApplication =&lt;BR /&gt;
CType(AcadApp.AcadApplication, AcadApplication)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...</description>
      <pubDate>Tue, 24 May 2005 15:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334404#M84976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334405#M84977</link>
      <description>&amp;gt;I do use 'Imports' or 'using' but sometimes you need the fully qualified &lt;BR /&gt;
&amp;gt;name to prevent &amp;gt;ambiguity (ie application is in more than one of your &lt;BR /&gt;
&amp;gt;imports)&lt;BR /&gt;
&lt;BR /&gt;
Isn't avoiding this the idea behind Namespaces, while enjoying short&lt;BR /&gt;
typing with using directives? Mike help??&lt;BR /&gt;
&lt;BR /&gt;
&lt;MARKGARDINER&gt; wrote in message news:4854118@discussion.autodesk.com...&lt;BR /&gt;
ks Mike&lt;BR /&gt;
&lt;BR /&gt;
I do use 'Imports' or 'using' but sometimes you need the fully qualified &lt;BR /&gt;
name to prevent ambiguity (ie application is in more than one of your &lt;BR /&gt;
imports)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
//c#   I was missing the (AcadApplication)&lt;BR /&gt;
Autodesk.AutoCAD.Interop.AcadApplication   _AcadApp = &lt;BR /&gt;
(AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
&lt;BR /&gt;
I didn't want to use GetActiveObject is this can return any running instance &lt;BR /&gt;
of acad and not necessarly the one my .net dll is loaded into.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Mark&lt;/MARKGARDINER&gt;</description>
      <pubDate>Tue, 24 May 2005 15:26:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334405#M84977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T15:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334406#M84978</link>
      <description>&amp;gt; Isn't avoiding this the idea behind Namespaces, while enjoying short&lt;BR /&gt;
&amp;gt; typing with using directives? Mike help??&lt;BR /&gt;
&lt;BR /&gt;
Yes, and actually depending upon how you write your code there are a few&lt;BR /&gt;
places where you still need to type it all out but I've only ever run into&lt;BR /&gt;
it with the managed API [Graphics], never with COM.Try this to see it:&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;
Imports Autodesk.AutoCAD.GraphicsInterface&lt;BR /&gt;
&lt;BR /&gt;
Then try declaring: Dim oVport As New Viewport&lt;BR /&gt;
&lt;BR /&gt;
You'll get the ambiguitity error. In my case here, I really wasn't using&lt;BR /&gt;
GraphicsInterface so I removed it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...</description>
      <pubDate>Tue, 24 May 2005 15:54:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334406#M84978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T15:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334407#M84979</link>
      <description>Thanks..&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message &lt;BR /&gt;
news:4854721@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; Isn't avoiding this the idea behind Namespaces, while enjoying short&lt;BR /&gt;
&amp;gt; typing with using directives? Mike help??&lt;BR /&gt;
&lt;BR /&gt;
Yes, and actually depending upon how you write your code there are a few&lt;BR /&gt;
places where you still need to type it all out but I've only ever run into&lt;BR /&gt;
it with the managed API [Graphics], never with COM.Try this to see it:&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;
Imports Autodesk.AutoCAD.GraphicsInterface&lt;BR /&gt;
&lt;BR /&gt;
Then try declaring: Dim oVport As New Viewport&lt;BR /&gt;
&lt;BR /&gt;
You'll get the ambiguitity error. In my case here, I really wasn't using&lt;BR /&gt;
GraphicsInterface so I removed it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/MTUERSLEY_NOT_&gt;</description>
      <pubDate>Tue, 24 May 2005 16:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334407#M84979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-24T16:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334408#M84980</link>
      <description>Hi,&lt;BR /&gt;
I have installed Architecture 2009 standalone version on my local machine. I am calling autocad document from Windows C# and getting the following error. Can you help me to fix this error?&lt;BR /&gt;
&lt;BR /&gt;
"Retrieving the COM class factory for component with CLSID {28B7AA99-C0F9-4C47-995E-8A8D729603A1} failed due to the following error: 80080005."&lt;BR /&gt;
&lt;BR /&gt;
My Code is:&lt;BR /&gt;
&lt;BR /&gt;
try&lt;BR /&gt;
                    {&lt;BR /&gt;
                        acadapp = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
                    }&lt;BR /&gt;
                    catch&lt;BR /&gt;
                      {&lt;BR /&gt;
                          try&lt;BR /&gt;
                          {&lt;BR /&gt;
                              Type acType = Type.GetTypeFromProgID("AutoCAD.Application");&lt;BR /&gt;
                              acadapp = (AcadApplication)Activator.CreateInstance(acType, true);&lt;BR /&gt;
                          }&lt;BR /&gt;
                          catch (System.Exception ex)&lt;BR /&gt;
                          {&lt;BR /&gt;
&lt;BR /&gt;
                          };&lt;BR /&gt;
&lt;BR /&gt;
                        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If I use the following code then application is throwing an error as " it is not able to find out form(class) name"&lt;BR /&gt;
&lt;BR /&gt;
acadapp = (Autodesk.AutoCAD.Interop.AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;</description>
      <pubDate>Mon, 07 Dec 2009 14:31:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334408#M84980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-07T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334409#M84981</link>
      <description>If the error happens when AutoCAD is running, then try &lt;BR /&gt;
"AutoCAD.Application.17.2" rather than just "AutoCAD.Application".&lt;BR /&gt;
&lt;BR /&gt;
To create a new instance of AutoCAD you can just use:&lt;BR /&gt;
&lt;BR /&gt;
        AcadApplication app = new AcadApplication();&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;PALANISELVAM&gt; wrote in message news:6300407@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
I have installed Architecture 2009 standalone version on my local machine. I &lt;BR /&gt;
am calling autocad document from Windows C# and getting the following error. &lt;BR /&gt;
Can you help me to fix this error?&lt;BR /&gt;
&lt;BR /&gt;
"Retrieving the COM class factory for component with CLSID &lt;BR /&gt;
{28B7AA99-C0F9-4C47-995E-8A8D729603A1} failed due to the following error: &lt;BR /&gt;
80080005."&lt;BR /&gt;
&lt;BR /&gt;
My Code is:&lt;BR /&gt;
&lt;BR /&gt;
try&lt;BR /&gt;
                    {&lt;BR /&gt;
                        acadapp = &lt;BR /&gt;
(AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
                    }&lt;BR /&gt;
                    catch&lt;BR /&gt;
                      {&lt;BR /&gt;
                          try&lt;BR /&gt;
                          {&lt;BR /&gt;
                              Type acType = &lt;BR /&gt;
Type.GetTypeFromProgID("AutoCAD.Application");&lt;BR /&gt;
                              acadapp = &lt;BR /&gt;
(AcadApplication)Activator.CreateInstance(acType, true);&lt;BR /&gt;
                          }&lt;BR /&gt;
                          catch (System.Exception ex)&lt;BR /&gt;
                          {&lt;BR /&gt;
&lt;BR /&gt;
                          };&lt;BR /&gt;
&lt;BR /&gt;
                        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If I use the following code then application is throwing an error as " it is &lt;BR /&gt;
not able to find out form(class) name"&lt;BR /&gt;
&lt;BR /&gt;
acadapp = &lt;BR /&gt;
(Autodesk.AutoCAD.Interop.AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;/PALANISELVAM&gt;</description>
      <pubDate>Mon, 07 Dec 2009 18:27:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334409#M84981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-07T18:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: using COM API in .net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334410#M84982</link>
      <description>Thanks Tony.  I opened AutoCAD 2009 through program menu and tried with the following code. It is working.  My concern is like why should I run AutoCAD s/w first and run this program. This is the case through my C# program I need to kickoff autocad software and use the following code to create the instance for ACAD document. How Can I kickoff AutoCAD s/w?&lt;BR /&gt;
&lt;BR /&gt;
AndI have some autocad document(linked with oracle db(uid/pwd). Through C#, I need to pass UID/PWD to open the Autocad document. Is there any way we can do that? &lt;BR /&gt;
try&lt;BR /&gt;
{&lt;BR /&gt;
acadapp = &lt;BR /&gt;
(AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
}&lt;BR /&gt;
catch&lt;BR /&gt;
{&lt;BR /&gt;
try&lt;BR /&gt;
{&lt;BR /&gt;
Type acType = &lt;BR /&gt;
Type.GetTypeFromProgID("AutoCAD.Application");&lt;BR /&gt;
acadapp = &lt;BR /&gt;
(AcadApplication)Activator.CreateInstance(acType, true);&lt;BR /&gt;
}&lt;BR /&gt;
catch (System.Exception ex)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
};&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
How can I pass user id / password to autocad document. I have seen the following code accepts only pwd:&lt;BR /&gt;
acadapp.Documents.Open(dtFileList.Rows[intRowCount]["FileName"].ToString(), false, pwd);&lt;BR /&gt;
Here If I pass pwd as string then autocad document should not prompt to enter UID/PWD. Is it possible?&lt;BR /&gt;
&lt;BR /&gt;
Thanks and Regards,&lt;BR /&gt;
Palani.

Edited by: palaniselvam on Dec 8, 2009 10:17 AM</description>
      <pubDate>Tue, 08 Dec 2009 10:10:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-com-api-in-net-dll/m-p/1334410#M84982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-08T10:10:54Z</dc:date>
    </item>
  </channel>
</rss>

