.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD crashes on Editor.GetPoint(XXX)

8 REPLIES 8
Reply
Message 1 of 9
TimFells
701 Views, 8 Replies

AutoCAD crashes on Editor.GetPoint(XXX)

I have been using .NET with AutoCAD 2007 successfully for some time, but I just loaded AutoCAD 2009, with a complete system upgrade to Windows XP: Windows XP SP 2; Visual Basic 2005 SP 1; AutoCAD 2009 Update 2; latest Framework 2.x and 3.0 updates, reboots up the wazoo, etc. etc.
Every time I call Editor.GetPoints(XXX), or Editor.Get anything else for that matter, AutoCAD 2009 crashes. No exception, no warning, no use using a try... catch... block, just down like a ton of bricks. I have made a class library that does nothing except call this function on a command called "test", but it still goes down. I have checked that acdbmgd and acmgd are not copied locally, and all the usual suspects but, at this point, I have a wholly useless AutoCAD installation.
Any ideas?
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: TimFells

Works for me with both Net 3.0 and 3.5

added this ==>
if (ppr.Status == PromptStatus.OK)
{
p = ppr.Value;
ed.WriteMessage(p.ToString());
}

got this ==>
Command: netload
Loading AutoCADTest2...
Command: test
Get Point: (415.386000380869,2204.55901050555,0)


wrote in message news:6081130@discussion.autodesk.com...
I have been using .NET with AutoCAD 2007 successfully for some time, but I
just loaded AutoCAD 2009, with a complete system upgrade to Windows XP:
Windows XP SP 2; Visual Basic 2005 SP 1; AutoCAD 2009 Update 2; latest
Framework 2.x and 3.0 updates, reboots up the wazoo, etc. etc. Every time I
call Editor.GetPoints(XXX), or Editor.Get anything else for that matter,
AutoCAD 2009 crashes. No exception, no warning, no use using a try...
catch... block, just down like a ton of bricks. I have made a class library
that does nothing except call this function on a command called "test", but
it still goes down. I have checked that acdbmgd and acmgd are not copied
locally, and all the usual suspects but, at this point, I have a wholly
useless AutoCAD installation. Any ideas?
Message 3 of 9
kdub_nz
in reply to: TimFells



Just for the fun of it ...



add this using statement

using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;



and change the ed assignment to

Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;



probably won't make a difference, but will ensure the correct Application is being called.

// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Message 4 of 9
Anonymous
in reply to: TimFells

Works for me with both Net 3.0 and 3.5

added this ==>
{code}
if (ppr.Status == PromptStatus.OK)
{
p = ppr.Value;
ed.WriteMessage(p.ToString());
}
{code}
got this ==>
Command: netload
Loading AutoCADTest2...
Command: test
Get Point: (415.386000380869,2204.55901050555,0)


// kdub tried again using {code} tags from the outlook express newsgroup
reader
Message 5 of 9
Anonymous
in reply to: TimFells

If your references to AutoCAD's managed assemblies
are not copied local, make sure they are pointing to
the AutoCAD 2009 folder. Same goes for all AutoCAD
assmblies that are in the AutoCAD root folder.

I don't know if your working code is this way, but the
demo you posted implements IExtensionApplication on
a class with non-static command methods. When a
method with the CommandMethod attribute applied
to it is not static, AutoCAD creates a new instance of
the class that declares the method, for each open
document. That could have something to do with it,
if you are caching some document specific data in a
static variable.

Implementing IExtensionApplication on a class with
command methods is not something I'd recommend.

Try changing your command method to static, and
see if doing nothing but that fixes it.

If that fails, try creating a new ClassLibrary project
rather than using Autodesk's wizard, and add the
references to the AutoCAD assemblies manually, and
do not implement commands in the same class that
implements IExtensionApplication, and see if you can
reproduce it with the new project.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6081130@discussion.autodesk.com...
I have been using .NET with AutoCAD 2007 successfully for some time, but I just loaded AutoCAD 2009, with a complete system upgrade to Windows XP: Windows XP SP 2; Visual Basic 2005 SP 1; AutoCAD 2009 Update 2; latest Framework 2.x and 3.0 updates, reboots up the wazoo, etc. etc. Every time I call Editor.GetPoints(XXX), or Editor.Get anything else for that matter, AutoCAD 2009 crashes. No exception, no warning, no use using a try... catch... block, just down like a ton of bricks. I have made a class library that does nothing except call this function on a command called "test", but it still goes down. I have checked that acdbmgd and acmgd are not copied locally, and all the usual suspects but, at this point, I have a wholly useless AutoCAD installation. Any ideas?
Message 6 of 9
TimFells
in reply to: TimFells

All - Thanks for the suggestions. I tried them all and nothing yet. One thing - the NET framework I compiled with is 2.0.50727. Should I be using 3.0? If so, how do I do that in Visual Studio 2005? The 2008 version has the "targeted Framework version" drop-down but I'm not sure where to find the various parts of .NET 3.0 using 2005.
Message 7 of 9
Anonymous
in reply to: TimFells


You don't need .NET 3.0.

 

Your project can target AutoCAD 2008 and it should
run

on AutoCAD 2009 as well, without a recomple.

 


 

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

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
All
- Thanks for the suggestions. I tried them all and nothing yet. One thing -
the NET framework I compiled with is 2.0.50727. Should I be using 3.0? If so,
how do I do that in Visual Studio 2005? The 2008 version has the "targeted
Framework version" drop-down but I'm not sure where to find the various parts
of .NET 3.0 using 2005.
Message 8 of 9
Anonymous
in reply to: TimFells


You don't need .NET 3.0.

 

Your project can target AutoCAD 2008 and it should run
on
AutoCAD 2009 as well, without a recomple.


 

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

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
All
- Thanks for the suggestions. I tried them all and nothing yet. One thing -
the NET framework I compiled with is 2.0.50727. Should I be using 3.0? If so,
how do I do that in Visual Studio 2005? The 2008 version has the "targeted
Framework version" drop-down but I'm not sure where to find the various parts
of .NET 3.0 using 2005.
Message 9 of 9
TimFells
in reply to: TimFells

I reinstalled AutoCAD and - Shazzam! - it worked. Voodoo, huh?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost