.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Demand Loading question

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
687 Views, 8 Replies

Demand Loading question

Hi all,

I found in this newsgroup this nice method for autoload a .NET application:
adding the app to "...\Autodesk\...\Applications" in the Registry. I still
have a few questions.

1. I have some document eventhandlers i'd like to initialize during startup
of AutoCAD. Is it possible to autostart a (registered) function in my app,
without using scripts or lisp?

2. What's the benefit of adding Commands and Groups at this location in the
Registry (all my functions in the dll defined by [CommandMethod ... ] work,
even if they are registered or not)? Or can I use this to define an
automatically starting function?

I'm using .NET for AutoCAD 2006.

Tnx
Henk
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

The LOADCTRLS entry controls how your app is loaded,
and there is a flag that will tell AutoCAD to load it at
startup automatically. See the ObjectARX docs for the
appropriate values.

--
http://www.caddzone.com

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

"Henk Loonstra" wrote in message news:5382433@discussion.autodesk.com...
Hi all,

I found in this newsgroup this nice method for autoload a .NET application:
adding the app to "...\Autodesk\...\Applications" in the Registry. I still
have a few questions.

1. I have some document eventhandlers i'd like to initialize during startup
of AutoCAD. Is it possible to autostart a (registered) function in my app,
without using scripts or lisp?

2. What's the benefit of adding Commands and Groups at this location in the
Registry (all my functions in the dll defined by [CommandMethod ... ] work,
even if they are registered or not)? Or can I use this to define an
automatically starting function?

I'm using .NET for AutoCAD 2006.

Tnx
Henk
Message 3 of 9
Anonymous
in reply to: Anonymous

Thanx Tony for your response.

My .NET application is automatically loaded at AutoCAD startup now, thanx to
these Register settings.
What I am looking for is a way to trigger a function (i.e. "void
MyOnAppStartUp()") automatically when my app is loaded.

Is this possible in .NET ?



"Tony Tanzillo" schreef in bericht
news:5383699@discussion.autodesk.com...
The LOADCTRLS entry controls how your app is loaded,
and there is a flag that will tell AutoCAD to load it at
startup automatically. See the ObjectARX docs for the
appropriate values.

--
http://www.caddzone.com

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

"Henk Loonstra" wrote in message
news:5382433@discussion.autodesk.com...
Hi all,

I found in this newsgroup this nice method for autoload a .NET application:
adding the app to "...\Autodesk\...\Applications" in the Registry. I still
have a few questions.

1. I have some document eventhandlers i'd like to initialize during startup
of AutoCAD. Is it possible to autostart a (registered) function in my app,
without using scripts or lisp?

2. What's the benefit of adding Commands and Groups at this location in the
Registry (all my functions in the dll defined by [CommandMethod ... ] work,
even if they are registered or not)? Or can I use this to define an
automatically starting function?

I'm using .NET for AutoCAD 2006.

Tnx
Henk
Message 4 of 9
Anonymous
in reply to: Anonymous

I saw this link in another tread:
http://discussion.autodesk.com/thread.jspa?messageID=4531456

The same question was asked there.
1. autoload the .NET dll using the Registry
2. autostart a function using autocad.lsp, .mnl or .cui.
Is this really the best way?



"Tony Tanzillo" schreef in bericht
news:5383699@discussion.autodesk.com...
The LOADCTRLS entry controls how your app is loaded,
and there is a flag that will tell AutoCAD to load it at
startup automatically. See the ObjectARX docs for the
appropriate values.

--
http://www.caddzone.com

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

"Henk Loonstra" wrote in message
news:5382433@discussion.autodesk.com...
Hi all,

I found in this newsgroup this nice method for autoload a .NET application:
adding the app to "...\Autodesk\...\Applications" in the Registry. I still
have a few questions.

1. I have some document eventhandlers i'd like to initialize during startup
of AutoCAD. Is it possible to autostart a (registered) function in my app,
without using scripts or lisp?

2. What's the benefit of adding Commands and Groups at this location in the
Registry (all my functions in the dll defined by [CommandMethod ... ] work,
even if they are registered or not)? Or can I use this to define an
automatically starting function?

I'm using .NET for AutoCAD 2006.

Tnx
Henk
Message 5 of 9
cgay
in reply to: Anonymous

Henk,

Have you looked at implementing the IExtensionApplication Interface?

They way this works is
1.you create a new class
2.implement the Autodesk.AutoCAD.Runtime.IExtensionApplication interface on this class.
3. add a assembly level attribute 'Autodesk.AutoCAD.Runtime.ExtensionApplicationAttribute' passing the system.type of your new class.

When autocad loads your add-in, it looks for the attribute (from #3) and if it finds it it looks as the type referenced for interface IExtensionApplication. If it finds the IExtensionApplication interface, it will fire the Initialize method of that interface. You could try to put your code there.

C
Message 6 of 9
Anonymous
in reply to: Anonymous

You can implement IExtensionApplication to execute
code when your assembly loads.

The Initialize() member is where you would do that.

--
http://www.caddzone.com

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

"Henk Loonstra" wrote in message news:5384185@discussion.autodesk.com...
I saw this link in another tread:
http://discussion.autodesk.com/thread.jspa?messageID=4531456

The same question was asked there.
1. autoload the .NET dll using the Registry
2. autostart a function using autocad.lsp, .mnl or .cui.
Is this really the best way?



"Tony Tanzillo" schreef in bericht
news:5383699@discussion.autodesk.com...
The LOADCTRLS entry controls how your app is loaded,
and there is a flag that will tell AutoCAD to load it at
startup automatically. See the ObjectARX docs for the
appropriate values.

--
http://www.caddzone.com

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

"Henk Loonstra" wrote in message
news:5382433@discussion.autodesk.com...
Hi all,

I found in this newsgroup this nice method for autoload a .NET application:
adding the app to "...\Autodesk\...\Applications" in the Registry. I still
have a few questions.

1. I have some document eventhandlers i'd like to initialize during startup
of AutoCAD. Is it possible to autostart a (registered) function in my app,
without using scripts or lisp?

2. What's the benefit of adding Commands and Groups at this location in the
Registry (all my functions in the dll defined by [CommandMethod ... ] work,
even if they are registered or not)? Or can I use this to define an
automatically starting function?

I'm using .NET for AutoCAD 2006.

Tnx
Henk
Message 7 of 9
Anonymous
in reply to: Anonymous

Wow, thanx again Tony and you too CougerAC !!!

This "entrypoint" is exactly what I needed.
I implemented a new class (i.e.: MyOwnApp: IExtensionApplication), and added
a public void Initialize() with code to initialize my eventhandlers.
Everything worked immediately without any error.

Regards,
Henk
Message 8 of 9
MRiemenCAD
in reply to: cgay

I'm using a similar entry point but am finding that the plugin is only viable within the drawing active when it was loaded. If i start a new drawing, or switch to another draiwng, the plugin (and it's commands and classes) isn't recognized. Any thoughts on how I can load my plugin into ALL drawings  either open or opened after the plugin is loaded?

Message 9 of 9
MRiemenCAD
in reply to: MRiemenCAD

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost