The MicroStation Programming Forum regularly receives postings asking some question about MicroStation Tag Sets and Tag data.
Here's the answer to questions posted to the Be Communities web site. See also our Tag Data Overview.
Q How can I attach tags to multiple shapes in a DGN model?
A MicroStation's built-in tag tools are interactive: they want you to choose an element, then choose a tag set, then update tag values for each element that you want to annotate. If you want to add tags to a number of elements, that manual task is iterative and tedious, and therefore open to the usual human failings. ShapeTagger provides a answer: it adds tags to many elements in one go. There is no human interaction required. ShapeTagger is freeware.
Q How can I report the area of multiple shapes in a DGN model?
A Another freeware tool, AreaAnnotator™, measures areas automatically and updates tags on area elements. ShapeTagger uses AreaAnnotator to measure the area of shapes and complex shapes, and update the tags it has attached. Using MicroStation's built-in tag reporting tools you can create a report of shape and complex shape areas. LA Solutions' FlexiTable™ is easier to use than MicroStation's built-in tag reporting tools and is compatible with Microsoft Excel®.
MicroStation Tags allow you to attach alpha-numeric attribute data to a graphic element. The effect is to build a database in your DGN model. MicroStation's tag tools and third-party products such as LA Solutions' FlexiTable™ let you create reports about tag data.
For example, you may have placed multiple cells in your DGN model, each cell representing a door. You want to tag each door in your DGN model with a unique ID. The ID tag provides a visual identity to a each member of a set of otherwise identical graphic elements. A report of the door tag set tells you how many doors exist in your model.
The example here deals with shape elements rather than cells. We have multiple shapes, complex shapes or other objects that have area. We want to assign each area an ID and measure its area. The solution provided here is a MicroStation VBA macro called ShapeTagger. ShapeTagger attaches tags to multiple area objects then sub-contracts the task of measuring their area to another application, AreaAnnotator. The result is a set of annotated shapes, each showing a unique ID and area.
The VBA example here was inspired by the question: "How can I attach tags to multiple elements?" MicroStation's tools let you tag one element at a time. It's a repetitive and tedious task. We publish and provide here a VBA macro that will attach tags to multiple shapes in a DGN model.
For more information about MicroStation tags, look at the Microstation help file. Alternatively, if you're a VBA developer, consult the MicroStation VBA Help manual delivered with MicroStation. Also, see our Tag Data Overview for VBA developers.
A MicroStation user inherited a DGN file. The file contains a model having multiple shapes. Our user wants to annotate each shape with its measured area, and assign each shape a unique ID. Those requirement will make it easy to cross-reference a tag report with the DGN model.
We wrote a MicroStation VBA macro to help speed up his task. The macro performs the following …
After the macro has completed, the shape elements are annotated with a unique ID and area …
If you just want to use this macro, download the ZIP file,
then unpack it and copy the
ShapeTagger.mvba file to a well-known MicroStation VBA folder.
A suitable folder is
How to use the ShapeTagger VBA macro …
vba run [ShapeTagger]modMain.Main
If everthing is set up correctly, you will see shape elements annotated with tags. Shapes on other levels remain unaffected. ShapeTagger does the work of finding shape elements and adding tag elements to each shape. Once it's finished scanning your DGN model, it calls on AreaAnnotator to perform its measurements and update the DGN model.
MicroStation has built-in tools for tag reporting. Third-party products, such as LA Solutions' FlexiTable™, provide other ways to gather tag information. We created the screenshot below by using FlexiTable to harvest the tag data, then exporting in Microsoft Excel®. The screenshot shows the report in an Excel worksheet …
This section is for VBA developers. It explains the internal structure of the VBA macro.
The macro illustrates several key topics …
The VBA code to scan the DGN model is conventional. It's similar to other examples that you will find on this web site and in the MicroStation VBA help manual.
The VBA code to attach elements is conventional. It's similar to other examples that you will find on this web site and in the MicroStation VBA help manual.
The macro does its work, which is to attach tags to each shape element. It doesn't take measurements of each area, because AreaAnnotator is explicitly designed for that task.
The macro checks to see if AreaAnnotator is already loaded, and if not queues
mdl load annotator command.
The macro queues the command
Annotator ID Enable Off.
That command tells AreaAnnotator not to provides its own IDs.
The macro queues the command
Annotator Synchronise All.
That command tells AreaAnnotator to find any component tagged with the zones tag set
and re-measure its area and perimeter.
AreaAnnotator updates the tags with the new measurements.
The simplest way is to use the form below. You will be forwarded to a page where you can download ShapeTagger. Note that ShapeTagger is bundled with AreaAnnotator. AreaAnnotator and ShapeTagger are freeware.
Click this request ShapeTagger link, then complete the form. You can then download a ZIP file containing the ShapeTagger VBA freeware application for MicroStation. Note that ShapeTagger is bundled with AreaAnnotator.