Tips Tagged: VBA

Clean Up After Yourself

You have probably heard some of these simple rules of life:
- If you open something, close it
- If you turn something on, turn it off
- If you spill something, wipe it up
These same rules apply to macro development. Many programmers get sloppy because they assume the computer will clean up for them. In most cases [...]

VBA Help

MicroStation VBA has a very robust help system with many examples for common tasks. To get help on a VBA function, property, etc. hit F2 on the keyboard to open the Object Browser. Selecting an item in the browser window will display the arguments and return value for the object. For more information right click [...]

Protecting VBA’s

If you have done much MicroStation VBA development at all you realize how easy it is for a casual or curious user to open the VBA Editor and possibly break your code. For internal company deployments you can modify the security on the .mvba files so that these users have read-only access. When distributing [...]

Using the Macro Recorder to Capture Commands

The MicroStation VBA Macro Recorder is a useful tool beyond just capturing workflows for creating your own macros. A common dilemma for users wanting to create Batch Process scripts, or their own custom toolboxes is knowing the key-in commands they need for the task they want to accomplish. Using the Macro Recorder to capture the [...]

Use Constants for Common Values

Some developers will calculate common values in code every time they are needed in an
application. This slows down your application as it has to calculate the value every time.
Others will enter in the straight numeric value, which is just frowned upon programming
practice. The best way to handle these values is to use VBA Constants.
‘Common degree [...]

Autorun MicroStation VBA

A common question asked by new VBA developers is how to automatically start a macro when you start MicroStation. There are several steps involved in this process.

Set your VBA project to autoload when MicroStation starts. This can be done by either adding the name of your VBA project to the MS_VBAAUTOLOADPROJECTS workspace variable, or by [...]

MicroStation GetInput

For those of you still wanting to convert MicroStation User Commands (UCM’s) to VBA
one way to ease your transition is to use the VBA CadInputQueue.GetInput method for
getting input from the user. This method most closely mimics the GET function in the
UCM language.
The example function below shows how you can use the GetInput method for placing [...]

MicroStation Element Enumerator

Many MicroStation vba’s use the ElementScanCriteria to build a list of elements in a model that match a set of selection criteria. The ElementEnumerator object is then used to iterate through all of the elements in the list. The sub below is a common example of this.
Sub EE_Example()
Dim ee As ElementEnumerator
[...]

String to MicroStation Master Unit Conversion

MicroStation allows users to input units as Sub Units by preceding the value with either a colon, “:6”, or two dots, “..6”. Users may also enter unit values in MU:SU:PU format. In MicroStation dialogs these input formats are automatically converted to their Master Unit equivalents. Unfortunately when writing your own VBA macros in MicroStation there [...]

User interface related code only in User Forms

A common practice for beginning developers is to place the macro processing code in the OK (or Apply) button click event sub of a User Form. While this may be easy, and keeps everything in one spot, it is not recommended. The only code in your User Forms should be the code required to collect [...]

« Older Entries
Seo Packages
What is seo - seo tips