MicroStation can be customised in various ways. This article shows how to create a fillet between two lines, using MicroStation Visual Basic for Applications (MVBA).
A Degree of Curve calculation is used by US rail designers. It is another way to construct a fillet or arc, useful when drawing a very large radius curve. See this article about calculating a Degree of Curve to draw a fillet.
Questions similar to these, posed by VBA developers, appear on the Bentley Discussion Groups, typically the MicroStation Programming Forum.
Q How can I Create a Fillet with MicroStation VBA?
The questionner is seeking an app to create a circular fillet between two lines, like this …
A The project is straightforward to implement using VBA. When you load and run the macro it pops this dialog …
The dialog has a text box where you can type the required radius of the fillet. The default radius is 1.0.
Click the Create Fillet button to start.
The macro prompts you to pick two linear elements.
In VBA terms, it wants you to pick two elements that implement the TraversableElement
interface.
There are several element types (e.g. lines, line-strings, curves) that implement that interface,
and all are suitable for filletting.
Once you've picked two elements, we have enough data to construct a fillet. The proposed fillet is shown in dynamics, so you can choose the quadrant of the lines where you want to create the fillet. On the final datapoint, we construct the fillet and add it to the active DGN model …
This VBA project demonstrates …
UserForm
when the macro starts
Element.ConstructFillet()
method
You can download the example VBA Construct Fillet project. The macro should run in both MicroStation CONNECT and MicroStation V8i.
Copy the .mvba
file to a known good location where MicroStation looks for VBA macros.
For example, ..\Organization\Standards\Macros
or any folder that configuration variable
MS_VBASEARCHDIRECTORIES
includes.
Open the project in the VBA editor.
Read the notes in module modMain
.
That module also contains the keyin to run the example …
vba run [ConstructFillet]modMain.Main
MicroStation® is a 3D computer-aided-design (CAD) application for personal computers and workstations. MicroStation is produced by Bentley Systems, Inc.
Post questions about VBA to the MicroStation Programming Forum.