Hi Bill,
at first I'd like to recommend two things:
- Please use Syntax highlighter tool (yellow pencil) and set Syntax to VB whenever you post any code.
- If it's possible, add also variable definitions to code snippet. In VBA is't usually easy to understand what type a particular variable is, but not always.
[quote user="Bill Hasted"]Te first line I assume is finding the desired Tag Set[/quote]
If eleTag.TagSetName = "RT_Title_A0_A1_A2" Then
No, it tests if existing TagElement is defined in the desired TagSet. To better understand this test, lets clarify how Tags work:
- TagSet is a container, that holds Tags Definitions. They are not displayable objects.
- If Tag is attached an element, TagElement is created in a design file and linked to the element and (optionally) displayed.
- TagElement holds value of the tag, but does not contain any information about the definition. But it know TagSet name and TagDefitionName, so if necessary, the tag definition can be searched.
[quote user="Bill Hasted"]My concern is the Erase part of the expression as I don't wish to erase any existing data.[/quote]
eleTag.Redraw msdDrawingModeErase
It does not erase anything, it redraws TagElement using specific draw mode. I guess after this line of code, it hides the tag (redraw to be erased from screen) until next view refresh. Redraw operations are not persistent, they only redraw particular element on screen.
Because we don't know details (how old is the code, what it does, in what MicroStation version the macro is used) it's hard to say if it's obsolete construction or a result of some specific requirement.
In the past, MicroStation developers should take care about displaying elements, especially in dynamics (placement, modification). It requires to understand how elements are displayed, what does it mean to redraw element in XOR mode etc. From V8 XM Edition it's not necessary and in the most situations developers (especially in VBA that hides a lot MicroStation implementation and operational details) don't have to take care about update views (e.g. after element is added or removed from model) or can use simple calls (de.g. during dynamic).
So I have to admit I understand what this line does, but I don't understand why it's used.
[quote user="Bill Hasted"]Is there a reference for MicroStation related commands that I am yet to find?[/quote]
It depends what information you are looking for. A combination of MicroStation help file (to understand how MicroStation works) and MicroStation VBA help file (an explanation of MicroStation VBA API) provides enough information for typical VBA macros. Learning MicroStation VBA book from is very good source of information as well as articles on Jon Summers' web.
For advanced VBA macros sometimes also MDL API documentation is reuquired, because it contains VBA wrappers description for MDL functions.
With regards,
Jan