Welcome CAD gurus!
Check out the latest free downloads. You don't have to be registered to download these
free examples, but if you are registered we'll send you a note when new downloads are available.
[click the example title to start the download.]
These tools are intended as examples only and are unsupported.
This mdl app will remove a selection set when the user clicks reset.
Capture information about your CAD environment and save/append to a common log file.
List references or xref path and name. User form example for both AutoCAD and MicroStation VBA included.
Set file properties in MicroStation and AutoCAD.
Cell Copy VBA This is a MicroStation VBA version of the old Cell Copy MDL application. The program will copy cells from a source cell library to a destination library. It's pretty easy to use. Just highlight the cells you want to copy in the source list. Use the ">>" button to add them to the destination cell list. Click the Add Selected button at the bottom of the source cell library listbox. You can delete cells you don't want in the destination library but be careful! This is an example with little error checking. So, backup your files before you modify them. More information is available on our our blog. See MicroStation Cell Copy VBA article for more information about the code. Oh, and this will work in both MicroStation and Powerdraft.
Timer Script The download zip file includes a script file named tststamp.vbs and a drawing file test.dgn. The example script expects a file c:\tmp\test.dgn. The folder and the drawing file need to exist before running the script. When the script is finished it will write a results file to c:\tmp called tout.txt. The results will show you how long it took to open and close the file test.dgn. This download is a companion to the blog - Experiences in CAD Management - System Performance
Accudraw Reset for V8i has the same functionality as the old command but compiled for the new version. It moves the focus from last menu edited to the accudraw menu when the reset button is clicked.
Dimbetween is a MicroStation VBA example that draws a dimension between two lines. I put this example together in response to a post Girish made on the Bentley newsgroup. We exchanged some emails and this is the result. Thanks Girish!
To use this command you select the first line, then the second line. At this point the dimension will start to draw between the two elements dynamically. A third datapoint is required to identify the placement point. The command uses ILocateCommandEvents class to handle the user input (to get the line elements and identify the place point). The draw logic is also located in the class. Study the sub routine called drawDimension to see how the command draws the dimension. Here's the basic approach I used to create the draw routine.
1) Project the cursor location to the second line element.
2) Create a really long line at the projection point perpendicular to the second line element.
3) Use the element created in step 2 to find an intersection point on line element 1.
4) Use the point from step 1, and the point from step 3 to draw the dimension element
4a) Calculate the rotation for the dimension using the point from step 1 and the point from step 3.
5) Add the new dimension to the file. The details are available by downloading the MVBA and reading through the source.
It's not complicated, and I'm sure you can adapt this approach to other commands.