Tips Tagged: VBA

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 manholes and inlets or above-ground structures. This has multiple benefits.  This includes 3D graphics in the drawing which provides a foundation for BIM, clash detection, I-models and more.  Additionally, OpenRoads will […]

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 the beauty of VBA, once you learn the language basics in say MicroStation, you can easily jump to developing applications in Excel, AutoCAD, or other platforms that support […]

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 elements. Once the ElementEnumerator object is set it can be used to iterate through all of the elements in the list and modify them if necessary. Developing general purpose, reusable, routines […]

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 beginning VBA programmers will run into problems using the CADInputQueue.SendDataPoint method. They want to select a particular MicroStation element, but their data point intersects with another element and the macro picks […]

VBA Tip: Using the With Statement

Written by Rod Wing.   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 requires an End With statement to close the block. An example of the with statement is shown below. Dim myCollection As Collection Set my Collection = New Collection ‘ Standard assignment myCollection.Add […]

VBA Tip: The IIF Statement

Written by Rod Wing.   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, and a different value if the expression is false. The syntax of the IIF statement is as follows: IIF(<conditional expression>,<TRUE return value>,<FALSE return value>) Here are examples for finding the […]

VBA Tip: Monitoring Variable Changes

Written by Rod Wing.   The Watch toggle button in the Debug toolbox opens or closes the Watch window. Individual variables and expressions can be watched for different conditions.   To add a variable or expression to the watch list highlight the value in the code window. Right click on the mouse and select Add Watch from the pop-up menu. The Add […]

« Older Entries
Privacy Policy