Freeware MicroStation VBA Macro: AutoCloud EnvisionCAD is rereleasing our suite of freeware MicroStation VBA macros for MicroStation CONNECT Edition. One macro, or set of macros, will be released each…
OpenRoads Tip: 3D Elements from Survey Data Written by: Bob Mecham OpenRoads Survey can automatically create 3D elements in your CAD file. Some uses are pipes, trees, and utility structures such as…
VBA Tip: Create Portable Functions Written by Rod Wing Once you begin writing VBA tools for one application you will probably expand to writing VBA tools for other applications as well. That’s…
VBA TIP: Maximize the MicroStation ElementEnumerator Written by Rod Wing The MicroStation ElementEnumerator object can be populated from a variety of sources: scan criteria, fences, selection sets, and complex…
VBA Tip: Pick the Right Element Written by Rod Wing Anyone who has done any MicroStation VBA programming, or recorded a MicroStation VBA macro, knows about the CADInputQueue class. Many…
VBA Tip: Using the With Statement The With statement allows for specifying members of an object or user-defined type in a more efficient and easier to read format. Each With statement…
VBA Tip: The IIF Statement The IIf statement is a shorthand type of If..Then..Else statement. It evaluates a conditional expression then returns one value if the expression is true,…
VBA Tip: Monitoring Variable Changes The Watch toggle button in the Debug toolbox opens or closes the Watch window. Individual variables and expressions can be watched for different…
VBA Tip: Message Box Buttons Written by Rod Wing. Message Boxes are most often used as a means to quickly display information to the user. Message boxes can also be used to get…
VBA Tip: Input Boxes Written by Rod Wing. Like a Message Box, the InputBox displays a modal dialog with a message/prompt string and a tile. With an InputBox there are…
VBA Tip: Get Current Value of All Your Variables Written by Rod Wing. The Locals toggle button in the Debug toolbox opens or closes the Locals window. The Locals window will display all of…
VBA Tip: Trim Text Input Written by Rod Wing. The Trim$ function removes any leading or trailing space characters from a string. ' returns "abc" strValue = Trim$ (" abc…
VBA Tip: Debug Written by Rod Wing. The Debug function is useful for setting conditional break expressions and for printing informational messages during execution of…
VBA Tip: Call Stack Written by Rod Wing. When in break mode, selecting the Call Stack button in the Debug toolbox displays the Call Stack window. The call stack…
VBA Tip: Variable Declaration Written by Rod Wing. Declare all your variables VBA does not require you to declare any variables, but it is highly recommended that you do so. Variables that…
VBA Tip: Object-Variable Naming Written by Rod Wing. Variable (or object) naming standards in the programming world can be compared to layer/level naming standards in the CAD world. Just as…
Comparing Floating Point Numbers Written by Rod Wing Transforming coordinates is a common task in many AutoCAD and MicroStation VBA programs. Coordinates in both applications are stored…
Error Handling All but the simplest of macros will need to deal with illegal inputs, files not being found, and other unexpected results. VBA provides the On Error GoTo…
Testing for the Existence of a File Written by Rod Wing. Many times in a macro you will need to determine if a file exists prior to opening it in an application, or using the Open…
Double Quote Characters in String Variables Written by Rod Wing. As you may know, when assigning a text string to a string variable the text is enclosed in “double quotes”. If you need to have…
Save User Inputs as Default Settings Written by Rod Wing. Many times in a macro you want to save user input so that it is stored and then recalled as the program’s default values…
ByRef and ByVal Written by Rod Wing. The ByRef and ByVal keywords are used when passing variables to subroutines and functions. Passing arguments by reference (ByRef)…
Putting your Macro to Sleep Sometimes it is necessary to suspend the operation of your macro for a certain length of time. There is no native function to do this in VBA so we are… Read…
Reading/Writing Text Files Being able to read from and write to text files in VBA is useful for the import/export of coordinate data as well as other file and configuration parameters.…
Learning VBA Have you purchased VBA books in the past hoping to teach yourself how to create VBA macros? While there are excellent, comprehensive, reference books…
Arrays Efficient Array Looping VBA provides the LBound and UBound functions for retrieving the lower and upper bounds of an array. When looping through an array…
MicroStation Messages MicroStation is fairly consistent in how it displays prompts and messages in the Status bar at the bottom of the window. To make your macros mimic standard…
MicroStation VBA Fundamentals Manual and Class Written by Bob Mecham. MicroStation VBA Fundamental Training and Manual from EnvisionCAD EnvisionCAD is pleased to announce our newest class offering and…
Toolsettings Key-ins The CadInputQueue.SendCommand and CadInputQueue.SendKeyin methods are easy ways for programmers to automate MicroStation tasks in their VBA macros. One…
Message Boxes Written by Rod Wing. Message Boxes are a means to quickly display information to the user. Message boxes can also used to get basic Yes/No or Boolean type…
VBA Macro Arguments Written by Rod Wing. MicroStation VBA allows for supplying arguments in a macro call, most other VBA implementations including the Microsoft Office apps to do…
Using Recursion in VBA Written by Rod Wing. Using Recursion in VBA Recursion is a programming technique where a sub or function calls itself. There are many examples where this can…