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

C# and AutoCAD 2009

6 REPLIES 6
Reply
Message 1 of 7
everts
396 Views, 6 Replies

C# and AutoCAD 2009

I am using "AutoCAD Civil 3D Land Desktop Companion 2009", i wrote a simple program for Land Desktop 2006 using .NET framework 2.0 (VS2005) and I want to migrate it to this new version of CAD, but I am not able to use the program, I can not load the form, I changed the old references to acdbmgd and acdbmgd to the newer ones, but it does not work. Do I need to use the .NET Framework 3.0? Or do I have a problem with CommandMethod? Is it different to show a form with this new version? I am sorry about my english
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: everts


There are some changes to the API between 2006 and later
releases,

which may be the cause of your problem. 

 

You would need to show what error messages you're getting in
order

for anyone to help you.


 

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">
I
am using "AutoCAD Civil 3D Land Desktop Companion 2009", i wrote a simple
program for Land Desktop 2006 using .NET framework 2.0 (VS2005) and I want to
migrate it to this new version of CAD, but I am not able to use the program, I
can not load the form, I changed the old references to acdbmgd and acdbmgd to
the newer ones, but it does not work. Do I need to use the .NET Framework 3.0?
Or do I have a problem with CommandMethod? Is it different to show a form with
this new version? I am sorry about my english
Message 3 of 7
everts
in reply to: everts

When I execute the command "netload" to load my dll and try to execute my personalized command (sondeos in this case) CAD show the following message: "command sondeos not found"

using System;
using System.Collections.Generic;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using System.Windows.Forms;

namespace Sondeos2._0
{
public class Principal
{
[CommandMethod("sondeo")]
public void mostrarFrmSondeos()
{
Form1 myForm = new Form1();
myForm.Show();
}
}
}
Message 4 of 7
Anonymous
in reply to: everts


I notice that you typed "
face="Times New Roman" size=3>sondeos" twice in your message. However, the
command method does not have the "s" on the end of the name. Could it be this
simple?

 

Joe ...

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
When
I execute the command "netload" to load my dll and try to execute my
personalized command (sondeos in this case) CAD show the following message:
"command sondeos not found"

using System;
using
System.Collections.Generic;
using System.Text;
using
Autodesk.AutoCAD.Runtime;
using System.Windows.Forms;

namespace
Sondeos2._0
{
public class Principal
{

[CommandMethod("sondeo")]
public void mostrarFrmSondeos()
{

Form1 myForm = new Form1();
myForm.Show();
}
}

}
Message 5 of 7
everts
in reply to: everts

no, sorry, my mistake when typing the message, that is not the problem. I will install VS2008, just to check if the problem is the Framework version
Message 6 of 7
CougerAC
in reply to: everts

Make sure Copy Local on acdbmgd and acmgd is set to False.
Also, you shouldn't show your form by calling form.Show().
You need to use either:
Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog (form)
or
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog (form)

Also, check the Error List in Visual Studio and resolve any errors/warnings.
Finally, check your acad.exe.config file to ensure that you are not explicitly specifying a lower runtime than you are compiling for.

Good Luck,
C
Message 7 of 7
Anonymous
in reply to: everts


This has nothing to do with the framework
version.

 

Things to check:

 

-   Using CommandClass attribute anywhere in

    the same assembly
size=2>requires that it be used

    on every class that implements
commands.

 

-  The assembly contains a class that implements

    IExtensionApplication,
size=2>whose Iinitialize() method

    is throwing an exception.

 

-  Running your code in the debugger, with
the

   'CopyLocal' property of references to
acmgd.dll

   or acdbmgd.dll set to True.  Set them
to false.


 

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">
When
I execute the command "netload" to load my dll and try to execute my
personalized command (sondeos in this case) CAD show the following message:
"command sondeos not found"

using System;
using
System.Collections.Generic;
using System.Text;
using
Autodesk.AutoCAD.Runtime;
using System.Windows.Forms;

namespace
Sondeos2._0
{
public class Principal
{

[CommandMethod("sondeo")]
public void mostrarFrmSondeos()
{

Form1 myForm = new Form1();
myForm.Show();
}
}

}

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