Load arx

Load arx

Anonymous
Not applicable
1,610 Views
7 Replies
Message 1 of 8

Load arx

Anonymous
Not applicable
Hello,

in old ActiveX, there is the possibilty to load an arx with

Application.LoadArx

and list the load arx with

Application.ListArx

Is there an aquivalent in dotnet?

Thanks for help

Tim
0 Likes
1,611 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Check out the ExtensionLoader Class. It has both Load and IsLoaded
methods.
"Tim Fields" wrote in message
news:[email protected]...
Hello,

in old ActiveX, there is the possibilty to load an arx with

Application.LoadArx

and list the load arx with

Application.ListArx

Is there an aquivalent in dotnet?

Thanks for help

Tim
0 Likes
Message 3 of 8

Anonymous
Not applicable
Thanks for your answer, but I tried ExtensionLoader.IsLoaded already. I
got an exception:


Application does not support just-in-time (JIT)
debugging. See the end of this message for details.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. ---> System.BadImageFormatException: Could
not load file or assembly 'D:\AutoCAD 2007\test.arx' or one of its
dependencies. The module was expected to contain an assembly manifest.
File name: 'D:\AutoCAD 2007\test.arx'
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.IsLoaded(String fileName)
at xyz.abc.test() in D:\test\clsMain.cs:line 32

=== Pre-bind state information ===
LOG: User = -\-
LOG: Where-ref bind. Location = D:\AutoCAD 2007\test.arx
LOG: Appbase = file:///D:/AutoCAD 2007/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

The arx I try to load is a non-managed arx (without clr support) created
in VS 2005 for AutoCAD 2007 and works properly.

Tim
0 Likes
Message 4 of 8

Anonymous
Not applicable
I thought you we're loading a managed extension. I don't know if there is a
class to load
an ARX. If nothing else maybe you could just use the ARX command?
"Tim Fields" wrote in message
news:[email protected]...
Thanks for your answer, but I tried ExtensionLoader.IsLoaded already. I
got an exception:


Application does not support just-in-time (JIT)
debugging. See the end of this message for details.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. ---> System.BadImageFormatException: Could
not load file or assembly 'D:\AutoCAD 2007\test.arx' or one of its
dependencies. The module was expected to contain an assembly manifest.
File name: 'D:\AutoCAD 2007\test.arx'
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.IsLoaded(String fileName)
at xyz.abc.test() in D:\test\clsMain.cs:line 32

=== Pre-bind state information ===
LOG: User = -\-
LOG: Where-ref bind. Location = D:\AutoCAD 2007\test.arx
LOG: Appbase = file:///D:/AutoCAD 2007/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

The arx I try to load is a non-managed arx (without clr support) created
in VS 2005 for AutoCAD 2007 and works properly.

Tim
0 Likes
Message 5 of 8

Anonymous
Not applicable
Hi Paul

The ExtensionLoader class is for managed extensions.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message news:[email protected]...
Check out the ExtensionLoader Class. It has both Load and IsLoaded
methods.
"Tim Fields" wrote in message
news:[email protected]...
Hello,

in old ActiveX, there is the possibilty to load an arx with

Application.LoadArx

and list the load arx with

Application.ListArx

Is there an aquivalent in dotnet?

Thanks for help

Tim
Message 6 of 8

Anonymous
Not applicable
using Autodesk.AutoCAD.Runtime;

SystemObjects.DynamicLinker.LoadModule(...);


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Tim Fields" wrote in message news:[email protected]...
Thanks for your answer, but I tried ExtensionLoader.IsLoaded already. I
got an exception:


Application does not support just-in-time (JIT)
debugging. See the end of this message for details.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. ---> System.BadImageFormatException: Could
not load file or assembly 'D:\AutoCAD 2007\test.arx' or one of its
dependencies. The module was expected to contain an assembly manifest.
File name: 'D:\AutoCAD 2007\test.arx'
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.IsLoaded(String fileName)
at xyz.abc.test() in D:\test\clsMain.cs:line 32

=== Pre-bind state information ===
LOG: User = -\-
LOG: Where-ref bind. Location = D:\AutoCAD 2007\test.arx
LOG: Appbase = file:///D:/AutoCAD 2007/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

The arx I try to load is a non-managed arx (without clr support) created
in VS 2005 for AutoCAD 2007 and works properly.

Tim
0 Likes
Message 7 of 8

Anonymous
Not applicable
YTM! As usual...Thanks.
"Tony Tanzillo" wrote in message
news:[email protected]...
Hi Paul

The ExtensionLoader class is for managed extensions.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message
news:[email protected]...
Check out the ExtensionLoader Class. It has both Load and IsLoaded
methods.
"Tim Fields" wrote in message
news:[email protected]...
Hello,

in old ActiveX, there is the possibilty to load an arx with

Application.LoadArx

and list the load arx with

Application.ListArx

Is there an aquivalent in dotnet?

Thanks for help

Tim
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thanks for all your answers.

Solved it with using the 'AutoCAD COM APIs from .NET' and
'ApplicationServices.Application.AcadApplication', which has LoadARX und
ListARX.

Tim
0 Likes