acad won't close after running dotnet app

acad won't close after running dotnet app

Anonymous
Not applicable
1,791 Views
18 Replies
Message 1 of 19

acad won't close after running dotnet app

Anonymous
Not applicable
I'm debugging a new vb.net app (acad 2009 and dotnet vb2008 express )
yes, it uses com interop but it's dotnet vb2008 express so am asking here as
well as vba

I keep running into the problem, just the last couple days, that after
testing the app, then closing acad to rebuild the dll,
acad is not closing - it closes on the screen, but acad.exe is still in the
process list in task mgr.

I kept ending the process via task mgr, since that was the only thing i
could do...but after a couple times of that acad quit working properly and i
had to do a repair install tody.

now it's still doning the same thing again, closes but acad.exe stil running

how to fix?
thanks
mark
0 Likes
1,792 Views
18 Replies
Replies (18)
Message 2 of 19

Anonymous
Not applicable
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368785@discussion.autodesk.com...
I'm debugging a new vb.net app (acad 2009 and dotnet vb2008 express )
yes, it uses com interop but it's dotnet vb2008 express so am asking here as
well as vba

I keep running into the problem, just the last couple days, that after
testing the app, then closing acad to rebuild the dll,
acad is not closing - it closes on the screen, but acad.exe is still in the
process list in task mgr.

I kept ending the process via task mgr, since that was the only thing i
could do...but after a couple times of that acad quit working properly and i
had to do a repair install tody.

now it's still doning the same thing again, closes but acad.exe stil running

how to fix?
thanks
mark
0 Likes
Message 3 of 19

Anonymous
Not applicable
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 4 of 19

Anonymous
Not applicable
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 5 of 19

arcticad
Advisor
Advisor
Make sure you release your references to AutoCAD

{code}
Public Sub ReleaseODBX(ByRef acadApp As Autodesk.AutoCAD.Interop.AcadApplication)
System.Runtime.InteropServices.Marshal.ReleaseComObject(acadapp)
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()

End Sub
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 6 of 19

Anonymous
Not applicable
Thanks arcticad,
would that go in the Finalize sub in my main class file?
Protected Overrides Sub Finalize()

MyBase.Finalize()

?---->add release acad here <----------------?

End Sub

I don't know where that sub came from, i think i used a previous code sample
and modified everything for my app. This finalize sub, i don't know if
that's something vb creates automatically when you creaet a class or if
someone wrote it and it's just there from before.

in a file called AcadCommands.vb there is this sub to start my current app
test

_

Public Sub CncArcList()

If inst Is Nothing Then inst = New MCSdxf



inst.GetFormCutListFromArcs()

End Sub

MCSdxf.vb is the class that creates acad and needs to release it.



wrote in message news:6369000@discussion.autodesk.com...
Make sure you release your references to AutoCAD

{code}
Public Sub ReleaseODBX(ByRef acadApp As
Autodesk.AutoCAD.Interop.AcadApplication)
System.Runtime.InteropServices.Marshal.ReleaseComObject(acadapp)
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()

End Sub
{code}
0 Likes
Message 7 of 19

Anonymous
Not applicable
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 8 of 19

Anonymous
Not applicable
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 9 of 19

Anonymous
Not applicable
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 10 of 19

Anonymous
Not applicable
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 11 of 19

Anonymous
Not applicable
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 12 of 19

Anonymous
Not applicable
Yes, NETLOAD loads a dll into AutoCAD's process.

So does demand-loading via the registry.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369723@discussion.autodesk.com...
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 13 of 19

Anonymous
Not applicable
Thanks for that.
Interestingly the search term "load into ACAD's process space" gets 0 hits
on the archives of this group in the webbrowser.
so out of curiousity, how would you "Not" load into acad's process space?
that would be similar to vb6 standalone exe when you use getobject to get a
ref to the acad object?
does dotnet actually create .exe? I thought it was just .dll? if it were
able to make exe I wouldn't think the problem with being unable to "protect"
ones' code would apply there?
thanks again
mark'


"Tony Tanzillo" wrote in message
news:6369785@discussion.autodesk.com...
Yes, NETLOAD loads a dll into AutoCAD's process.

So does demand-loading via the registry.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369723@discussion.autodesk.com...
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 14 of 19

Anonymous
Not applicable
also interesting is, after your statement
"...you can't use acmdg.dll or acdbmgd.dll, because"
and before your last answer,...
i deleted the reference to acdbmgd.dll - and the code still compiles
so apparently i'm not using that one.
if i delete acMgd, i get an error on:
_

so apparently that one is required.

I want to migrate my code and thinking to the net api asap but for now have
pressing time deadlines and lots of other duties beyond coding so an going
with the com that is more familiar.

thanks

Mark





"Tony Tanzillo" wrote in message
news:6369785@discussion.autodesk.com...
Yes, NETLOAD loads a dll into AutoCAD's process.

So does demand-loading via the registry.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369723@discussion.autodesk.com...
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 15 of 19

Anonymous
Not applicable
Searching for exact phrases (with surrounding double quotes)
usually doesn't produce many results. Try it without the double
quotes.

{quote}

does dotnet actually create .exe? I thought it was just .dll?

{quote}

Sorry, but I don't understand your question. Are you asking
if you can build an executable with Visual Studio?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369826@discussion.autodesk.com...
Thanks for that.
Interestingly the search term "load into ACAD's process space" gets 0 hits
on the archives of this group in the webbrowser.
so out of curiousity, how would you "Not" load into acad's process space?
that would be similar to vb6 standalone exe when you use getobject to get a
ref to the acad object?
does dotnet actually create .exe? I thought it was just .dll? if it were
able to make exe I wouldn't think the problem with being unable to "protect"
ones' code would apply there?
thanks again
mark'


"Tony Tanzillo" wrote in message
news:6369785@discussion.autodesk.com...
Yes, NETLOAD loads a dll into AutoCAD's process.

So does demand-loading via the registry.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369723@discussion.autodesk.com...
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 16 of 19

Anonymous
Not applicable
You had asked if it was a standalone executable or loaded into acad's
process space.
I didn't realize dotnet(ie vb dot net 2008 express) could create exe's.
but maybe standalone executable doesn't mean .exe necessarily.
sorry for my total ignorance of the terminology.
:-)
mark


"Tony Tanzillo" wrote in message
news:6369831@discussion.autodesk.com...
Searching for exact phrases (with surrounding double quotes)
usually doesn't produce many results. Try it without the double
quotes.

{quote}

does dotnet actually create .exe? I thought it was just .dll?

{quote}

Sorry, but I don't understand your question. Are you asking
if you can build an executable with Visual Studio?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369826@discussion.autodesk.com...
Thanks for that.
Interestingly the search term "load into ACAD's process space" gets 0 hits
on the archives of this group in the webbrowser.
so out of curiousity, how would you "Not" load into acad's process space?
that would be similar to vb6 standalone exe when you use getobject to get a
ref to the acad object?
does dotnet actually create .exe? I thought it was just .dll? if it were
able to make exe I wouldn't think the problem with being unable to "protect"
ones' code would apply there?
thanks again
mark'


"Tony Tanzillo" wrote in message
news:6369785@discussion.autodesk.com...
Yes, NETLOAD loads a dll into AutoCAD's process.

So does demand-loading via the registry.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369723@discussion.autodesk.com...
thanks, I'll have to go do some research on that.
I thought i'd read somewhere that netload was loading into acad's process.
mark

"Tony Tanzillo" wrote in message
news:6369601@discussion.autodesk.com...
It's not how a DLL is loaded that matters. It's whether a
DLL is loaded into AutoCAD's process or not. If it is not,
then you can't use acmdg.dll or acdbmgd.dll, because
those DLLs can only be used from code that's running in
AutoCAD's process.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369569@discussion.autodesk.com...
Thank you much.
As i mentioned, i've just been copying previous examples.
Now that i think about it, this sample came from a dll we have here that is
(i think the term is demand loaded?) via a registry entry...
Since i'm just starting to learn net, i went the netload way for this
initial debugging phase and havent' learned the ins and outs of loading via
registry....
so that must be why the GetObject call is there...
so is that correct, if a dll is loaded via registry, does that mean it's a
"standalone exe" ,,. even tho it's a dll not an exe as in vb6?

:-)
Appreciate the lessons!
Mark

"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 17 of 19

Anonymous
Not applicable
darn, i changed the get acad function and it still isn't closing on
exit(remains hung in taskmgr)
Private Function GetAutoCADInstance() As AcadApplication

Dim m_AcadApp As AcadApplication = Nothing

Try

m_AcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

Catch ex As Exception

m_Util.Logentry("Failed to get acad application " + ex.Message)

m_AcadApp = Nothing

End Try

Return m_AcadApp

End Function

fwiw the loop that's crashing is:

I'm drawing objects and adding to an array so i can add the array to a
selection set to pass to wblock

adding the objects one at a time is working, then i array a line which
returns an array of line objects

so i have to loop through that arrya to add to the original array

Dim retObj As Object

m_Util.Logentry("Array Kerf lines")

retObj = oSideLine.ArrayRectangular(NumberKerfs, 1, 1, KerfOffset, 0, 0)

'For Each o As AcadEntity In retObj

For i As Integer = 0 To UBound(retObj)

m_Util.Logentry("index " & i)

Try

ReDim ArrayObjects(UBound(ArrayObjects) + 1)

'ArrayObjects(UBound(ArrayObjects)) = o

ArrayObjects(UBound(ArrayObjects)) = retObj(i)

Catch ex As ApplicationException

m_Util.Logentry("error " & ex.Message)

End Try

Next

m_Util.Logentry("Done putting array in selection set")

Try

If ArrayObjects Is Nothing Then

m_Util.Logentry("error ArrayObjects Is Nothing")

Else

m_Util.Logentry("add ArrayObjects to selection set")

SelectionSetWblock.AddItems(ArrayObjects)

End If



Catch ex As ApplicationException

End Try

after index 20 i get a null object error...don't understand why



thanks

mark



"Tony Tanzillo" wrote in message
news:6369257@discussion.autodesk.com...
You never use GetObject() to get the AcadApplication when
your code is NETLOADed.

You use:

acadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication

And you don't need to call ReleaseComObject()
or doing anything else.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6369148@discussion.autodesk.com...
I'll have to do some reading on those two. This creates a dll that gets
loaded with netload.
not sure what that makes it.(the create acad was in the sample code i used
to convert to my app)
just working from existing code and adapting to learn dotnet(along with some
online course and websearches ngs etc)
so, yes, i'm probably making a complet mess of it.
:-)

thanks
mark

"Tony Tanzillo" wrote in message
news:6368911@discussion.autodesk.com...
You didn't mention if this is an AutoCAD extension or
a standalone executable. If its the former, then you don't
use GetObject() to get the AutoCAD application.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6368905@discussion.autodesk.com...
"Tony Tanzillo" wrote in message
news:6368884@discussion.autodesk.com...
No one can guess why that's happening and you're not
providing very much information about your app or what
it does.

true, i was just guessing it was a general issue that may have been a common
occurance,.
the app gets an instance of acad, prompts to select an arc, presents a
couple inputboxes for user input, calculates some double values, creates
some lines, adds the lines to an array, adds the array to a selection set,
and tries to wblock the selection set to a new file - which i then will try
to convert to a dxf file.

the get acad is:
Private Function GetAutoCADInstance() As AcadApplication
Dim m_AcadApp As AcadApplication = Nothing
Try
'get currently running Autocad object if available
m_AcadApp = TryCast(GetObject(, "AutoCAD.Application"),
AcadApplication)
Catch ex As Exception
m_AcadApp = Nothing
End Try
Return m_AcadApp
End Function

if the app crashes, (due to me being stupid and working out bugs) is when
acad is left in the process
- now the last few times that happened it's actually closing when i tell it
to close.

the line that was creating the crash I found was calling
SelectionSet.AddItems (object) wrong.
I was passsing an object, not an array of objects

since i fixed that, the hanging process problem seems to have gone away.

even though the .AddItems was in a try catch loop it apparently didn't help
wtih that error.
thanks
mark
0 Likes
Message 18 of 19

Anonymous
Not applicable
I think this would be a valuable reference for you.

http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx
0 Likes
Message 19 of 19

Anonymous
Not applicable
Thanks nathTay,
Excellent reference.
do you think the acad sticking in task mgr is due to not setting = nothing
somewhere?
i'm still getting random, sometimes it closes, sometimes not...
sometimes due to error, sometimes even with no error....
at least that's what seems to be happening...i'm not 100% sure, but
generally i have to restart windows every time i revise and rebuild...
thanks
mark

wrote in message news:6370045@discussion.autodesk.com...
I think this would be a valuable reference for you.

http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx
0 Likes