Customization in Autocad with Visual basic

Customization in Autocad with Visual basic

Anonymous
Not applicable
1,629 Views
1 Reply
Message 1 of 2

Customization in Autocad with Visual basic

Anonymous
Not applicable

Hi Guys,

 

I am having an issue in linking a Visual Basic Editor with AutoCAD Mechanical.

 

wherein i intend to make changes in AutoCAD from the Visual Basic Editor of AutoCAD.

 

I have attached the the design intent.

 

My main aim being to vary the length and width using the dialogue box in "Capture 2"(Image)

 

Many thanks in advance.

1,630 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Dear Avinash:

 

You have to create a macro that calls the UserForm and then link that macro to a button in the toolbar. In your case:

 

1) Create a new module (you can use any module of course) called "CallUserForm". Inside that module write the following code:

 

Sub CallTrial()

Trial.show

End Sub

 

If you run that macro you will see the UserForm "Trial" running on the screen. Now you have to link that macro to a button so you don't have to open the Visual Basic editor everytime.

 

2) Type "CUI" in the Command Line.

3) Create a new button in the Command List section (press the star). As you can see, you can edit everything (name, image, description, element ID, macro, etc.)

4) In the "macro" section, type this:

 

"^C^C_.-vbarun;CallUserForm.CallTrial"

 

5) Now you can add your new button to the toolbars in the "Customization in All Files" windows.

 

Cheers!!