Original Article Date: Jan 31, 2002
This article first appeared on Bentley's MicroStation newsgroup and is authored by Brien Bastings, one of the developers behind MicroStation V8. (Thanks Brien!!) It deals with some of the complexities when working with cells and tags / attributes in MicroStation V8. A definite must read for all users!
Note: The content of this article is applicable to MicroStation V8 08.00.02.02 and laterHow can I work with tags in AutoCAD files under DWG_WORKMODE?One method of working with tags in MicroStation DGN files is to define a tag set and then use the Attach Tags tool to associate an instance of that tag set (I.e. tag elements) to a particular element in the design file. This method of working with tags is not compatible with DWG files since attributes in AutoCAD must be part of a cell definition (Block). You can attach tags to shared cells (and only shared cells) when working with DWG files, but those tags will be specific to that shared cell instance only. The right way of working with tags and cells is to make the tags part of the cell definition. Pre-V8 MicroStation did have some support for tags in cells, but it did not support shared cells. This restriction was removed in V8; and when V8 represents blocks from AutoCAD they are always shared cells.So what is the proper way to create a cell containing tags?The first thing to do is to define your tags in the usual fashion using the Element > Tags > Define dialog:
NOTE: When in DWG_WORKMODE the name given to your tag set is not important; AutoCAD only has tags and does not have the concept of a "tag set". When a DWG file is opened, a tag set is manufactured for all the tags in a particular shared cell definition using the name of the shared cell.Also, even though you are allowed to define different data types for your tags, they will always be converted to type “Character” when saved to DWG.After drawing the geometry that you want for your cell, choose the Attach Tags tool from the Tags tool box. To place the tag definition elements in the file, un-check the Associative toggle and enter a data point.
Notice that the tag definition element displays the tag name “Part Number”. This happened because the Associateve option was disabled. Had this switch been ON, MicroStation would have attached the value of the tag when the tag was attached to the shape. In addition, the tag definition elements will always be visible with the Display Tag property controlling whether the tag will display when an instance of this cell is placed.NOTE: Since you aren't associating the tag to elements, it is possible to create a cell that only contains tag elements.Now create a cell using your favorite approach. The typical pre-V8 method would be to place a fence around the elements, define the cell origin, then hit the create button from the Cell Library dialog.
NOTE: Since cells are just models in V8 you could have created a new model to draw the cell geometry in. You would then be able to attach that model as a cell library, and place it as cell.Also, notice how the cell preview shows our tagged cell with displaying it's default value instead of the tag name.Placing instances of your cell:You're now ready to start placing instances of your tagged cell! You can place the cell as either a shared cell or a normal cell.
NOTE: When in DWG_WORKMODE you will only have the option to create shared cells and the Use Shared Cells toggle in the Cell Library dialog will be checked and disabled.Changing the default value of the attached tag elements:After placing the tagged cell simply use the Edit Tags tool to change the tags values/visibility from it's default setting as needed.
AskInga Article #98