AutoCAD Drawing Automation : Part 1 - Create custom toolbar and button

Submitted by techrev on Mon, 09/25/2017 - 11:49
AutoCAD Software Development

AUTOCAD DRAWING AUTOMATION FREE TUTORIALS

In this tutorial, we will see how to create your own command button and insert it to the custom toolbar (name it under your organization/institution). when you click on those buttons, it can perform certain pre-written actions like draw objects, add dimensions, change properties, change drawing scale, printing, export to other data formats like excel/access database. there will be more tutorials on each subject soon..

Now, let us begin with the basic toolbar/button creation

 

PART 1 : CREATE CUSTOM TOOLBAR and BUTTONS

STEPS

Step 1 : Create a new CAD Drawing and Save it

Step 2 : Open VBA Editor (Tools->Macro->Visual Basic Editor (see below image)) by Pressing ALT + F11

Autocad drawing automation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 3 : Insert a module (Module1) - define your functions and save it

Step 4 : Right click on AutoCAD window, then select "Customize" (see below)

autocad custom software

 

 

 

 

 

 

 

Step 5 : Create a new command and name it then add its macro command

eg :- ^C^C_-vbarun;Module1.functionname

Step 6 : Create a toolbar and name it, then drag the new command from the commands list to the toolbar section (under newly created toolbar)

Step 7 : Save it (dont forget to load the project, while opening the new cad drawings - refer previous articles to find out how to do that)

DONE !

See below video 

 

Keywords : Autocad design software development CAD Software Custom cad software development insert custom command for autocad autocad customization autocad vba projects

 

Tags