<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: acad won't close after running dotnet app in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662292#M66026</link>
    <description>You had asked if it was a standalone executable or loaded into acad's &lt;BR /&gt;
process space.&lt;BR /&gt;
I didn't realize dotnet(ie vb dot net 2008 express) could create exe's.&lt;BR /&gt;
but maybe standalone executable doesn't mean .exe necessarily.&lt;BR /&gt;
sorry for my total ignorance of the terminology.&lt;BR /&gt;
:-)&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369831@discussion.autodesk.com...&lt;BR /&gt;
Searching for exact phrases (with surrounding double quotes)&lt;BR /&gt;
usually doesn't produce many results. Try it without the double&lt;BR /&gt;
quotes.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll?&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Sorry, but I don't understand your question. Are you asking&lt;BR /&gt;
if you can build an executable with Visual Studio?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369826@discussion.autodesk.com...&lt;BR /&gt;
Thanks for that.&lt;BR /&gt;
Interestingly the search term "load into ACAD's process space" gets 0 hits&lt;BR /&gt;
on the archives of this group in the webbrowser.&lt;BR /&gt;
so out of curiousity, how would you "Not" load into acad's process space?&lt;BR /&gt;
that would be similar to vb6 standalone exe when you use getobject to get a&lt;BR /&gt;
ref to the acad object?&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll? if it were&lt;BR /&gt;
able to make exe I wouldn't think the problem with being unable to "protect"&lt;BR /&gt;
ones' code would apply there?&lt;BR /&gt;
thanks again&lt;BR /&gt;
mark'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369785@discussion.autodesk.com...&lt;BR /&gt;
Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
    <pubDate>Thu, 08 Apr 2010 20:12:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-04-08T20:12:20Z</dc:date>
    <item>
      <title>acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662277#M66011</link>
      <description>I'm debugging a new vb.net app (acad 2009 and dotnet vb2008 express )&lt;BR /&gt;
yes, it uses com interop but it's dotnet vb2008 express so am asking here as &lt;BR /&gt;
well as vba&lt;BR /&gt;
&lt;BR /&gt;
I keep running into the problem, just the last couple days, that after &lt;BR /&gt;
testing the app, then closing acad to rebuild the dll,&lt;BR /&gt;
acad is not closing - it closes on the screen, but acad.exe is still in the &lt;BR /&gt;
process list in task mgr.&lt;BR /&gt;
&lt;BR /&gt;
I kept ending the process via task mgr, since that was the only thing i &lt;BR /&gt;
could do...but after a couple times of that acad quit working properly and i &lt;BR /&gt;
had to do a repair install tody.&lt;BR /&gt;
&lt;BR /&gt;
now it's still doning the same thing again, closes but acad.exe stil running&lt;BR /&gt;
&lt;BR /&gt;
how to fix?&lt;BR /&gt;
thanks&lt;BR /&gt;
mark</description>
      <pubDate>Wed, 07 Apr 2010 17:10:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662277#M66011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T17:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662278#M66012</link>
      <description>No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6368785@discussion.autodesk.com...&lt;BR /&gt;
I'm debugging a new vb.net app (acad 2009 and dotnet vb2008 express )&lt;BR /&gt;
yes, it uses com interop but it's dotnet vb2008 express so am asking here as&lt;BR /&gt;
well as vba&lt;BR /&gt;
&lt;BR /&gt;
I keep running into the problem, just the last couple days, that after&lt;BR /&gt;
testing the app, then closing acad to rebuild the dll,&lt;BR /&gt;
acad is not closing - it closes on the screen, but acad.exe is still in the&lt;BR /&gt;
process list in task mgr.&lt;BR /&gt;
&lt;BR /&gt;
I kept ending the process via task mgr, since that was the only thing i&lt;BR /&gt;
could do...but after a couple times of that acad quit working properly and i&lt;BR /&gt;
had to do a repair install tody.&lt;BR /&gt;
&lt;BR /&gt;
now it's still doning the same thing again, closes but acad.exe stil running&lt;BR /&gt;
&lt;BR /&gt;
how to fix?&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 07 Apr 2010 18:34:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662278#M66012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T18:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662279#M66013</link>
      <description>"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common &lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a &lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates &lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set, &lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try &lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"), &lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when &lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it &lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling &lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help &lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 07 Apr 2010 18:47:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662279#M66013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T18:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662280#M66014</link>
      <description>You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 07 Apr 2010 19:00:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662280#M66014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T19:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662281#M66015</link>
      <description>Make sure you release your references to AutoCAD&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
    Public Sub ReleaseODBX(ByRef acadApp As Autodesk.AutoCAD.Interop.AcadApplication)&lt;BR /&gt;
        System.Runtime.InteropServices.Marshal.ReleaseComObject(acadapp)&lt;BR /&gt;
        GC.Collect()&lt;BR /&gt;
        GC.WaitForPendingFinalizers()&lt;BR /&gt;
        GC.Collect()&lt;BR /&gt;
&lt;BR /&gt;
    End Sub&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 07 Apr 2010 20:00:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662281#M66015</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-04-07T20:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662282#M66016</link>
      <description>Thanks arcticad,&lt;BR /&gt;
would that go in the Finalize sub in my main class file?&lt;BR /&gt;
Protected Overrides Sub Finalize()&lt;BR /&gt;
&lt;BR /&gt;
MyBase.Finalize()&lt;BR /&gt;
&lt;BR /&gt;
?----&amp;gt;add release acad here &amp;lt;----------------?&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
I don't know where that sub came from, i think i used a previous code sample &lt;BR /&gt;
and modified everything for my app. This finalize sub, i don't know if &lt;BR /&gt;
that's something vb creates automatically when you creaet a class or if &lt;BR /&gt;
someone wrote it and it's just there from before.&lt;BR /&gt;
&lt;BR /&gt;
in a file called AcadCommands.vb there is this sub to start my current app &lt;BR /&gt;
test&lt;BR /&gt;
&lt;BR /&gt;
&lt;COMMANDMETHOD&gt; _&lt;BR /&gt;
&lt;BR /&gt;
Public Sub CncArcList()&lt;BR /&gt;
&lt;BR /&gt;
If inst Is Nothing Then inst = New MCSdxf&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
inst.GetFormCutListFromArcs()&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
MCSdxf.vb is the class that creates acad and needs to release it.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;ARCTICAD&gt; wrote in message news:6369000@discussion.autodesk.com...&lt;BR /&gt;
Make sure you release your references to AutoCAD&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
    Public Sub ReleaseODBX(ByRef acadApp As &lt;BR /&gt;
Autodesk.AutoCAD.Interop.AcadApplication)&lt;BR /&gt;
        System.Runtime.InteropServices.Marshal.ReleaseComObject(acadapp)&lt;BR /&gt;
        GC.Collect()&lt;BR /&gt;
        GC.WaitForPendingFinalizers()&lt;BR /&gt;
        GC.Collect()&lt;BR /&gt;
&lt;BR /&gt;
    End Sub&lt;BR /&gt;
{code}&lt;/ARCTICAD&gt;&lt;/COMMANDMETHOD&gt;</description>
      <pubDate>Wed, 07 Apr 2010 22:14:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662282#M66016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T22:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662283#M66017</link>
      <description>I'll have to do some reading on those two.  This creates a dll that gets &lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used &lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some &lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 07 Apr 2010 22:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662283#M66017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-07T22:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662284#M66018</link>
      <description>You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 08 Apr 2010 03:58:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662284#M66018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T03:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662285#M66019</link>
      <description>Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is &lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this &lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via &lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a &lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 08 Apr 2010 15:33:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662285#M66019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T15:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662286#M66020</link>
      <description>It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 08 Apr 2010 16:05:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662286#M66020</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T16:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662287#M66021</link>
      <description>thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 08 Apr 2010 18:10:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662287#M66021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T18:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662288#M66022</link>
      <description>Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 08 Apr 2010 18:58:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662288#M66022</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T18:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662289#M66023</link>
      <description>Thanks for that.&lt;BR /&gt;
Interestingly the search term "load into ACAD's process space" gets 0 hits &lt;BR /&gt;
on the archives of this group in the webbrowser.&lt;BR /&gt;
so out of curiousity, how would you "Not" load into acad's process space?&lt;BR /&gt;
that would be similar to vb6 standalone exe when you use getobject to get a &lt;BR /&gt;
ref to the acad object?&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll? if it were &lt;BR /&gt;
able to make exe I wouldn't think the problem with being unable to "protect" &lt;BR /&gt;
ones' code would apply there?&lt;BR /&gt;
thanks again&lt;BR /&gt;
mark'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369785@discussion.autodesk.com...&lt;BR /&gt;
Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 08 Apr 2010 19:36:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662289#M66023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T19:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662290#M66024</link>
      <description>also interesting is, after your statement&lt;BR /&gt;
 "...you can't use acmdg.dll or acdbmgd.dll, because"&lt;BR /&gt;
and before your last answer,...&lt;BR /&gt;
i deleted the reference to acdbmgd.dll - and the code still compiles&lt;BR /&gt;
so apparently i'm not using that one.&lt;BR /&gt;
if i delete acMgd, i get an error on:&lt;BR /&gt;
&lt;COMMANDMETHOD&gt; _&lt;BR /&gt;
&lt;BR /&gt;
so apparently that one is required.&lt;BR /&gt;
&lt;BR /&gt;
I want to migrate my code and thinking to the net api asap but for now have &lt;BR /&gt;
pressing time deadlines and lots of other duties beyond coding so an going &lt;BR /&gt;
with the com that is more familiar.&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369785@discussion.autodesk.com...&lt;BR /&gt;
Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/COMMANDMETHOD&gt;</description>
      <pubDate>Thu, 08 Apr 2010 19:44:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662290#M66024</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T19:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662291#M66025</link>
      <description>Searching for exact phrases (with surrounding double quotes)&lt;BR /&gt;
usually doesn't produce many results. Try it without the double&lt;BR /&gt;
quotes.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll?&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Sorry, but I don't understand your question. Are you asking&lt;BR /&gt;
if you can build an executable with Visual Studio?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:6369826@discussion.autodesk.com...&lt;BR /&gt;
Thanks for that.&lt;BR /&gt;
Interestingly the search term "load into ACAD's process space" gets 0 hits&lt;BR /&gt;
on the archives of this group in the webbrowser.&lt;BR /&gt;
so out of curiousity, how would you "Not" load into acad's process space?&lt;BR /&gt;
that would be similar to vb6 standalone exe when you use getobject to get a&lt;BR /&gt;
ref to the acad object?&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll? if it were&lt;BR /&gt;
able to make exe I wouldn't think the problem with being unable to "protect"&lt;BR /&gt;
ones' code would apply there?&lt;BR /&gt;
thanks again&lt;BR /&gt;
mark'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369785@discussion.autodesk.com...&lt;BR /&gt;
Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 08 Apr 2010 19:58:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662291#M66025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T19:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662292#M66026</link>
      <description>You had asked if it was a standalone executable or loaded into acad's &lt;BR /&gt;
process space.&lt;BR /&gt;
I didn't realize dotnet(ie vb dot net 2008 express) could create exe's.&lt;BR /&gt;
but maybe standalone executable doesn't mean .exe necessarily.&lt;BR /&gt;
sorry for my total ignorance of the terminology.&lt;BR /&gt;
:-)&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369831@discussion.autodesk.com...&lt;BR /&gt;
Searching for exact phrases (with surrounding double quotes)&lt;BR /&gt;
usually doesn't produce many results. Try it without the double&lt;BR /&gt;
quotes.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll?&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Sorry, but I don't understand your question. Are you asking&lt;BR /&gt;
if you can build an executable with Visual Studio?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369826@discussion.autodesk.com...&lt;BR /&gt;
Thanks for that.&lt;BR /&gt;
Interestingly the search term "load into ACAD's process space" gets 0 hits&lt;BR /&gt;
on the archives of this group in the webbrowser.&lt;BR /&gt;
so out of curiousity, how would you "Not" load into acad's process space?&lt;BR /&gt;
that would be similar to vb6 standalone exe when you use getobject to get a&lt;BR /&gt;
ref to the acad object?&lt;BR /&gt;
does dotnet actually create .exe? I thought it was just .dll? if it were&lt;BR /&gt;
able to make exe I wouldn't think the problem with being unable to "protect"&lt;BR /&gt;
ones' code would apply there?&lt;BR /&gt;
thanks again&lt;BR /&gt;
mark'&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369785@discussion.autodesk.com...&lt;BR /&gt;
Yes, NETLOAD loads a dll into AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
So does demand-loading via the registry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369723@discussion.autodesk.com...&lt;BR /&gt;
thanks, I'll have to go do some research on that.&lt;BR /&gt;
I thought i'd read somewhere that netload was loading into acad's process.&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369601@discussion.autodesk.com...&lt;BR /&gt;
It's not how a DLL is loaded that matters. It's whether a&lt;BR /&gt;
DLL is loaded into AutoCAD's process or not. If it is not,&lt;BR /&gt;
then you can't use acmdg.dll or acdbmgd.dll, because&lt;BR /&gt;
those DLLs can only be used from code that's running in&lt;BR /&gt;
AutoCAD's process.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369569@discussion.autodesk.com...&lt;BR /&gt;
Thank you much.&lt;BR /&gt;
As i mentioned, i've just been copying previous examples.&lt;BR /&gt;
Now that i think about it, this sample came from a dll we have here that is&lt;BR /&gt;
(i think the term is demand loaded?) via a registry entry...&lt;BR /&gt;
Since i'm just starting to learn net, i went the netload way for this&lt;BR /&gt;
initial debugging phase and havent' learned the ins and outs of loading via&lt;BR /&gt;
registry....&lt;BR /&gt;
so that must be why the GetObject call is there...&lt;BR /&gt;
so is that correct, if a dll is loaded via registry, does that mean it's a&lt;BR /&gt;
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?&lt;BR /&gt;
&lt;BR /&gt;
:-)&lt;BR /&gt;
Appreciate the lessons!&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 08 Apr 2010 20:12:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662292#M66026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T20:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662293#M66027</link>
      <description>darn, i changed the get acad function and it still isn't closing on &lt;BR /&gt;
exit(remains hung in taskmgr)&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
&lt;BR /&gt;
Try&lt;BR /&gt;
&lt;BR /&gt;
m_AcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
Catch ex As Exception&lt;BR /&gt;
&lt;BR /&gt;
m_Util.Logentry("Failed to get acad application " + ex.Message)&lt;BR /&gt;
&lt;BR /&gt;
m_AcadApp = Nothing&lt;BR /&gt;
&lt;BR /&gt;
End Try&lt;BR /&gt;
&lt;BR /&gt;
Return m_AcadApp&lt;BR /&gt;
&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
fwiw the loop that's crashing is:&lt;BR /&gt;
&lt;BR /&gt;
I'm drawing objects and adding to an array so i can add the array to a &lt;BR /&gt;
selection set to pass to wblock&lt;BR /&gt;
&lt;BR /&gt;
adding the objects one at a time is working, then i array a line which &lt;BR /&gt;
returns an array of line objects&lt;BR /&gt;
&lt;BR /&gt;
so i have to loop through that arrya to add to the original array&lt;BR /&gt;
&lt;BR /&gt;
Dim retObj As Object&lt;BR /&gt;
&lt;BR /&gt;
m_Util.Logentry("Array Kerf lines")&lt;BR /&gt;
&lt;BR /&gt;
retObj = oSideLine.ArrayRectangular(NumberKerfs, 1, 1, KerfOffset, 0, 0)&lt;BR /&gt;
&lt;BR /&gt;
'For Each o As AcadEntity In retObj&lt;BR /&gt;
&lt;BR /&gt;
For i As Integer = 0 To UBound(retObj)&lt;BR /&gt;
&lt;BR /&gt;
    m_Util.Logentry("index " &amp;amp; i)&lt;BR /&gt;
&lt;BR /&gt;
Try&lt;BR /&gt;
&lt;BR /&gt;
    ReDim ArrayObjects(UBound(ArrayObjects) + 1)&lt;BR /&gt;
&lt;BR /&gt;
'ArrayObjects(UBound(ArrayObjects)) = o&lt;BR /&gt;
&lt;BR /&gt;
    ArrayObjects(UBound(ArrayObjects)) = retObj(i)&lt;BR /&gt;
&lt;BR /&gt;
Catch ex As ApplicationException&lt;BR /&gt;
&lt;BR /&gt;
    m_Util.Logentry("error " &amp;amp; ex.Message)&lt;BR /&gt;
&lt;BR /&gt;
End Try&lt;BR /&gt;
&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
m_Util.Logentry("Done putting array in selection set")&lt;BR /&gt;
&lt;BR /&gt;
Try&lt;BR /&gt;
&lt;BR /&gt;
If ArrayObjects Is Nothing Then&lt;BR /&gt;
&lt;BR /&gt;
m_Util.Logentry("error ArrayObjects Is Nothing")&lt;BR /&gt;
&lt;BR /&gt;
Else&lt;BR /&gt;
&lt;BR /&gt;
m_Util.Logentry("add ArrayObjects to selection set")&lt;BR /&gt;
&lt;BR /&gt;
SelectionSetWblock.AddItems(ArrayObjects)&lt;BR /&gt;
&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Catch ex As ApplicationException&lt;BR /&gt;
&lt;BR /&gt;
End Try&lt;BR /&gt;
&lt;BR /&gt;
after index 20 i get a null object error...don't understand why&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6369257@discussion.autodesk.com...&lt;BR /&gt;
You never use GetObject() to get the AcadApplication when&lt;BR /&gt;
your code is NETLOADed.&lt;BR /&gt;
&lt;BR /&gt;
You use:&lt;BR /&gt;
&lt;BR /&gt;
   acadApp = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
And you don't need to call ReleaseComObject()&lt;BR /&gt;
or doing anything else.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6369148@discussion.autodesk.com...&lt;BR /&gt;
I'll have to do some reading on those two.  This creates a dll that gets&lt;BR /&gt;
loaded with netload.&lt;BR /&gt;
not sure what that makes it.(the create acad was in the sample code i used&lt;BR /&gt;
to convert to my app)&lt;BR /&gt;
just working from existing code and adapting to learn dotnet(along with some&lt;BR /&gt;
online course and websearches ngs etc)&lt;BR /&gt;
so, yes, i'm probably making a complet mess of it.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368911@discussion.autodesk.com...&lt;BR /&gt;
You didn't mention if this is an AutoCAD extension or&lt;BR /&gt;
a standalone executable. If its the former, then you don't&lt;BR /&gt;
use GetObject() to get the AutoCAD application.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"mp" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:6368905@discussion.autodesk.com...&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6368884@discussion.autodesk.com...&lt;BR /&gt;
No one can guess why that's happening and you're not&lt;BR /&gt;
providing very much information about your app or what&lt;BR /&gt;
it does.&lt;BR /&gt;
&lt;BR /&gt;
true, i was just guessing it was a general issue that may have been a common&lt;BR /&gt;
occurance,.&lt;BR /&gt;
the app gets an instance of acad, prompts to select an arc, presents a&lt;BR /&gt;
couple inputboxes for user input, calculates some double values, creates&lt;BR /&gt;
some lines, adds the lines to an array, adds the array to a selection set,&lt;BR /&gt;
and tries to wblock the selection set to a new file - which i then will try&lt;BR /&gt;
to convert to a dxf file.&lt;BR /&gt;
&lt;BR /&gt;
the get acad is:&lt;BR /&gt;
Private Function GetAutoCADInstance() As AcadApplication&lt;BR /&gt;
        Dim m_AcadApp As AcadApplication = Nothing&lt;BR /&gt;
        Try&lt;BR /&gt;
            'get currently running Autocad object if available&lt;BR /&gt;
            m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),&lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            m_AcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return m_AcadApp&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
if the app crashes, (due to me being stupid and working out bugs) is when&lt;BR /&gt;
acad is left in the process&lt;BR /&gt;
- now the last few times that happened it's actually closing when i tell it&lt;BR /&gt;
to close.&lt;BR /&gt;
&lt;BR /&gt;
the line that was creating the crash I found was calling&lt;BR /&gt;
SelectionSet.AddItems (object) wrong.&lt;BR /&gt;
I was passsing an object, not an array of objects&lt;BR /&gt;
&lt;BR /&gt;
since i fixed that, the hanging process problem seems to have gone away.&lt;BR /&gt;
&lt;BR /&gt;
even though the .AddItems was in a try catch loop it apparently didn't help&lt;BR /&gt;
wtih that error.&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 08 Apr 2010 21:44:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662293#M66027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T21:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662294#M66028</link>
      <description>I think this would be a valuable reference for you.&lt;BR /&gt;
&lt;BR /&gt;
http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx</description>
      <pubDate>Fri, 09 Apr 2010 01:05:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662294#M66028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-09T01:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: acad won't close after running dotnet app</title>
      <link>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662295#M66029</link>
      <description>Thanks nathTay,&lt;BR /&gt;
Excellent reference.&lt;BR /&gt;
do you think the acad sticking in task mgr is due to not setting = nothing &lt;BR /&gt;
somewhere?&lt;BR /&gt;
i'm still getting random, sometimes it closes, sometimes not...&lt;BR /&gt;
sometimes due to error, sometimes even with no error....&lt;BR /&gt;
at least that's what seems to be happening...i'm not 100% sure, but &lt;BR /&gt;
generally i have to restart windows every time i revise and rebuild...&lt;BR /&gt;
thanks&lt;BR /&gt;
mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATHTAY&gt; wrote in message news:6370045@discussion.autodesk.com...&lt;BR /&gt;
I think this would be a valuable reference for you.&lt;BR /&gt;
&lt;BR /&gt;
http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx&lt;/NATHTAY&gt;</description>
      <pubDate>Fri, 09 Apr 2010 20:55:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acad-won-t-close-after-running-dotnet-app/m-p/2662295#M66029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-09T20:55:50Z</dc:date>
    </item>
  </channel>
</rss>

