• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    *Henk Loonstra

    Demand Loading question

    274 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
    Please use plain text.
    *Tony Tanzillo

    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
    Please use plain text.
    *Henk Loonstra

    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
    Please use plain text.
    *Henk Loonstra

    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
    Please use plain text.
    Distinguished Contributor
    Posts: 125
    Registered: ‎08-02-2005

    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
    Please use plain text.
    *Tony Tanzillo

    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
    Please use plain text.
    *Henk Loonstra

    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
    Please use plain text.
    Valued Contributor
    iwcwoodworker
    Posts: 59
    Registered: ‎03-31-2003

    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?

    Please use plain text.
    Valued Contributor
    iwcwoodworker
    Posts: 59
    Registered: ‎03-31-2003

    Re: Demand Loading question

    08-03-2012 08:49 AM in reply to: iwcwoodworker
    Please use plain text.