Toolsettings Key-ins

The CadInputQueue.SendCommand and CadInputQueue.SendKeyin methods are easy ways for programmers to automate MicroStation tasks in their VBA macros.  One problem that users encounter is how to adjust the Tool settings for a particular command. As it turns out there is a key-in command that can help with that as well.

To find the Tool settings key-ins for an individual tool select the tool from the menu. In this example we are using Place Block. With the tool active open the Key-in window and enter the string: set item toolsettings but do not hit Enter. The available toolsettings key-ins for the active tool will be displayed in the far right list box. Those key-ins can be used in your macro with the SendKeyin method to ensure the toolsettings are configured correctly.

 

Place Block toolsettings
    With CadInputQueue
        'Start place block tool
        .SendCommand "place block icon"
        'set the block type to Orthogonal
        .SendKeyin "set item toolsettings placeblocktype=0"
        'set the area to Solid
        .SendKeyin "set item toolsettings elementarea=0"
        'set the fill type to Opaque
        .SendKeyin "set item toolsettings elementfill=1"

        'set the fill color to 3
        .SendKeyin "set item toolsettings elementfillcolor=3"
    End With

 

Rod Wing

Rod Wing

Rod joined EnvisionCAD in March 2007 and has nearly three decades of experience working in the CADD industry. He led the IT evaluations of Bentley InRoads and AutoDesk Civil 3D at Wisconsin DOT in their overall CAiCE replacement evaluation. He also led the MicroStation V7 to V8 upgrade effort at Wisconsin DOT which included updating not only the CADD standards to accommodate the changes in the file format but also updating legacy MDL and macros to work in the new environment. Rod received a Bachelor of Science degree from the University of Wisconsin in Cartography and a Master of Science in Geographic and Cartographic Sciences from George Mason University. Rod has extensive experience in CADD as well as the areas of GIS, cartography, plotting, scanning, raster editing/manipulation, publishing, and file/data translations. In all of these areas, he has produced custom tools and developed workflows to enhance productivity between diverse sets of applications. He instructs MicroStation classes ranging from fundamentals to advanced applications.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *