Starting with AutoCAD Commands

Starting with AutoCAD Commands

Anonymous
Not applicable
880 Views
3 Replies
Message 1 of 4

Starting with AutoCAD Commands

Anonymous
Not applicable

I have just started delving into the whole AutoCAD world, I have been tasked with creating a command and just making it work from the AUTOCAD make wizard, I know this might sound as basic as it can get, but i have checked the various tutorials and also the manual that comes with the OEM installation, but I still cannot get my command to work. Here are the steps I have taken so far

 

  1. Create new Project
  2. Entered project information
  3. Loaded my .net C# command dll( only one command), I set the build type of the module to BindMngd
  4. Set the command in the module settings window, e.g TestCommand under commands
  5. Then build.

 

The works completes successfully without any errors but I cannot access the command from the created AutoCAD, I am am unsure what might be wrong.

 

I have decorated my command class with the command class attribute using the assembly directive. I have also created a void method that i decorated with the commandMethod attribute, all it does is create a predefined string on the screen.

 

Thanks in advance.

0 Likes
881 Views
3 Replies
Replies (3)
Message 2 of 4

ActivistInvestor
Mentor
Mentor

@Anonymous wrote:

I have just started delving into the whole AutoCAD world, I have been tasked with creating a command and just making it work from the AUTOCAD make wizard, I know this might sound as basic as it can get, but i have checked the various tutorials and also the manual that comes with the OEM installation, but I still cannot get my command to work. Here are the steps I have taken so far

 

  1. Create new Project
  2. Entered project information
  3. Loaded my .net C# command dll( only one command), I set the build type of the module to BindMngd
  4. Set the command in the module settings window, e.g TestCommand under commands
  5. Then build.

 

The works completes successfully without any errors but I cannot access the command from the created AutoCAD, I am am unsure what might be wrong.

 

I have decorated my command class with the command class attribute using the assembly directive. I have also created a void method that i decorated with the commandMethod attribute, all it does is create a predefined string on the screen.

 

Thanks in advance.


"the manual that comes with the OEM installation".

 

What OEM installation is that?  AutoCAD OEM ?

 

I wouldn't expect anyone who reads your post to be able to tell you what the problem is, because you haven't posted any code, and that means one can only guess about what's wrong. The symptoms seem very much like there is an exception being thrown when your DLL is loaded. If that happens, AutoCAD doesn't register your commands, and they are not available.

 

0 Likes
Message 3 of 4

BKSpurgeon
Collaborator
Collaborator

hi there

 

i agree with activist - it's nigh impossible to identify  your problem given the information you've provided.

 

but nonetheless perhaps the following might be of assistance:

 

  • a screencast i recorded and
  • .net wizards

 

 

 

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1911627

 

wizards.PNG

 

 

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi There, sorry if I did not provide enough information. I am using AutoCAD OEM 2017, I have gotten to the point where I can build and run the commands, here is what was missing

 

  1. The Logical Name
  2. Load Controls ( I set it to 2)
  3. Enabled Managed Code  in Visual Studio
  4. Enabled Native Code Mode.

And the commands works and registers in AutoCAD after that, what still doesnt work is NETLOAD, after setting LoadControls to 0, Netload will crash the application. I think I will need to need to read a bit more about akllowed Paths in AutoCAD from the info that I found on the NET.

0 Likes