.NET

Reply
*Henk Loonstra
Message 1 of 9 (425 Views)

Demand Loading question

425 Views, 8 Replies
11-02-2006 02:32 AM
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
*Tony Tanzillo
Message 2 of 9 (425 Views)

Re: Demand Loading question

11-02-2006 03:25 PM in reply to: *Henk Loonstra
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
*Henk Loonstra
Message 3 of 9 (425 Views)

Re: Demand Loading question

11-03-2006 05:44 AM in reply to: *Henk Loonstra
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
*Henk Loonstra
Message 4 of 9 (425 Views)

Re: Demand Loading question

11-03-2006 05:55 AM in reply to: *Henk Loonstra
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
Distinguished Contributor
cgay
Posts: 125
Registered: ‎08-02-2005
Message 5 of 9 (425 Views)

Re: Demand Loading question

11-03-2006 12:30 PM in reply to: *Henk Loonstra
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
*Tony Tanzillo
Message 6 of 9 (425 Views)

Re: Demand Loading question

11-03-2006 03:02 PM in reply to: *Henk Loonstra
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
*Henk Loonstra
Message 7 of 9 (425 Views)

Re: Demand Loading question

11-04-2006 12:42 PM in reply to: *Henk Loonstra
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
Valued Contributor
MRiemenCAD
Posts: 62
Registered: ‎03-31-2003
Message 8 of 9 (263 Views)

Re: Demand Loading question

06-29-2012 08:02 AM 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?

Valued Contributor
MRiemenCAD
Posts: 62
Registered: ‎03-31-2003
Message 9 of 9 (224 Views)

Re: Demand Loading question

08-03-2012 08:49 AM in reply to: MRiemenCAD
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.