Hi everybody, I am new to Microstation and VBA. Can someone help me how I can remove all the spot height cells and texts (annotation) in the dgn file.
For example. Spot Height Text# level Number 8013(Level Name: Spot Elevation) and 4 (Level Name: Grid-Construction-Annotation)
Spot Height Cell# Level Number 8013
The above Spot Height Cells & Text should be removed in the dgn using VBA code
A quick way to turn levels on/off is to use MicroStation's level keyins to do so. The blog entry below shows some simple and more complex ways you can control what you see on the screen. If you really need to "remove" the annotation and/or cell then consider using ActiveModelReference.RemoveElement oCell.
Key-ins to switch levels on/off in a master file and (nested) referencese.g. set levels on/off "level name";selview 1
HTH,Bob
Thanks Robert for your reply,
Is there any sample vba file to understand it well?
If you find a sequence of keyins to meet your needs you can use execute keyins in MicroStation VBA directly bu calling e.g. CadInputQueue.SendKeyin "CONSTRUCT SURFACE CROSSSECTION".
Ideally you will want to build your experience using the MicroStation VBA object model to replace those keyins, but for now you can keep it simple.
Another item to consider if you have a number of keyins to be executed sequentially, would be to place those groups of keyins in a MicroStation "script file". A MicroStation script file is simply a text file that you place on your local drive or a network share, then run by using the ampersand symbol ("@") followed immediately by the full path and file name of the file to be run. That file can only contain valid MicroStation and MDL application keyins. Once you test your script file in MicroStation, you can change your VBA keyin to then be: CadInputQueue.SendKeyin "@C:\MicroStationScripts\Script1.txt"