29.01.2017 Views

UPDATED

Customizing-BricsCAD-V17

Customizing-BricsCAD-V17

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dialog Box with Code<br />

In an earlier chapter, I showed you how to construct a dialog box using DCL, and then add the LISP<br />

code to make it work. The dialog box looked like this:<br />

The dialog box displays the current value of three system variables:<br />

• Last point reports the current value of the LastPoint system variable.<br />

• Last angle reports the value of LastAngle (read-only).<br />

• Last prompt reports the value of LastPrompt (read-only).<br />

Title of the dialog box<br />

Names of system variables<br />

and their values<br />

OK button to exit dialog box<br />

Let’s repeat the tutorial, this time using VBA to do both jobs done separately by DCL and LISP before<br />

– designing the dialog box and writing-running the code.<br />

DESIGNING THE DIALOG BOX<br />

Dialog boxes are designed with the VBA programming environment, as follows:<br />

1. Start BricsCAD, and then use the Tools | VBA | Visual Basic for Applications command to open the VBA programming<br />

environment.<br />

2. Start a new Userform. (From the Insert menu, choose UserFrom.) Notice that VBA creates a generic dialog<br />

box named UserForm1.<br />

3. Change the name on the title bar by following these steps:<br />

a. Open the Properties palette. (From the View menu, choose Properties Window.)<br />

23 Dabbling in VBA 419

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!