Home Products E-Store Services Partners Company

VBA Sample to Change Text

In this article, we will make an application using Visual Basic for Applications (VBA) which will change the Height, Layer, Style or Color of selected text within a drawing. You can use the 'Select Objects' button to select any objects on screen by using any of the standard selection methods, or you can choose 'Select All' to select all text entities. The application will automatically filter out all non-text entities.

Collecting user input

The Layers, Text Styles in the current drawing need to populate the dialog first while initializing the dialog box. Then the user can enter the new values of Height, Layer, Style and Color. After typing or choosing the change needed the check boxes should be checked to get the effect in the drawing area.

Write the program in VBA editor

VBA editor is invoked by using the command "VBAIDE" (or by pressing Alt+F11). Note that, only CADopia Premium and the Professional version support VBA.

At first insert a Form from 'Insert' -> 'UserForm' and design the user dialog as shown above:

To change the properties, right-click on the tools (Textbox, Command Button, ComboBox) and set the properties accordingly.

Read More

Newsletter Feedback

CADopia Request an evaluation CD
This offer is valid for Australia, Canada, India, Singapore, UK and USA addresses only.
E-Store
Contact sales@cadopia.com for more details.
CADopia 2008 All Rights Reserved.
Home | Products | E-Store | Services | Partners | Company