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

    .NET

    Reply
    Active Contributor
    Posts: 43
    Registered: ‎04-21-2005

    Loading and Unloading .NET extensions

    195 Views, 3 Replies
    05-28-2005 11:32 PM
    It is a wasting time stopping and re-starting AutoCAD just to make simple code changes or when debugging their plugins.
    Can someone solve this problem?
    There is a post about this topic in http://www.cadvault.com/forums/thread15360.html
    Please use plain text.
    *Simon

    Re: Loading and Unloading .NET extensions

    05-29-2005 07:14 AM in reply to: tangferry
    The starting and stopping really gets on my nerves. I thought to use a
    Windows Application and reference the current drawing from it as was
    possible in VB6 but I can't suss out the equivelant of the statements below
    to reference Autocad 2006 from vb.net.

    Dim CadApp As AcadApplication
    Dim CadDwg As AcadDocument
    Set CadApp = GetObject(, "AutoCAD.Application")
    Set CadDwg = CadApp.ActiveDocument

    If anyone knows the answer please post as at least you could change code
    then compile the thing into a class when finished.

    Simon


    wrote in message news:4859656@discussion.autodesk.com...
    It is a wasting time stopping and re-starting AutoCAD just to make simple
    code changes or when debugging their plugins.
    Can someone solve this problem?
    There is a post about this topic in
    http://www.cadvault.com/forums/thread15360.html
    Please use plain text.
    *Frank Oquendo

    Re: Loading and Unloading .NET extensions

    05-29-2005 09:17 AM in reply to: tangferry
    Simon wrote:

    > If anyone knows the answer please post as at least you could change
    > code then compile the thing into a class when finished.

    GetObject still works in VB.NET but returns a ComObject, not an
    AcadApplication object. Use the CType function to cast that ComObject to the
    appropriate type. This will address your earlier question about circles as
    well.
    Please use plain text.
    *Albert Szilvasy

    Re: Loading and Unloading .NET extensions

    05-29-2005 10:43 AM in reply to: tangferry
    .NET plugins are currently unloadable. There's no way around it. The reason
    is fairly simple:
    .NET framework does not allow the unloading of individual assemblies (there
    are good reason for this, you can read about them here:
    http://blogs.msdn.com/jasonz/archive/2004/05/31/145105.aspx)

    There are ways arounds this: we could load plugins into their own appdomains
    and then when you want to unload the plugin we could destroy the appdomain
    effectively unloading the plugin. We are looking into making this happen in
    a future release.

    Albert

    wrote in message news:4859656@discussion.autodesk.com...
    It is a wasting time stopping and re-starting AutoCAD just to make simple
    code changes or when debugging their plugins.
    Can someone solve this problem?
    There is a post about this topic in
    http://www.cadvault.com/forums/thread15360.html
    Please use plain text.