I am trying to migrate from Microstation V8i to CONNECT Edition, and when I run my custom VBA blocks elements are drawn with all tags visible, even though both the tag configuration settings and t he VBA code both have the tags set to hidden. Is this a bug? Is there another setting somewhere else I am missing?
Carl Stanton said:VBA in CONNECT Edition
What is the exact version no. (e.g. v10.x.y.z) of MicroStation that you are using? Use key-in VERSION to see the version no. in the MicroStation Message Center, or Help→About MicroStation in the backstage.
VERSION
See this blog that shows you how to obtain MicroStation's version number.
There is a Programming Forum that would be a better place to post your question about VBA. You can move your post using the More=>Move button.
Regards, Jon Summers LA Solutions
Version 10.16.01.56
You're probably aware that Bentley Systems tell us that tags are deprecated in MicroStation CONNECT. However, many people, like yourself, use tags and have written code to handle tags. They are unlikely to disappear from MicroStation in this decade.
However, Bentley Systems would rather that we concentrate on new, shiny, features like Item Types. I suspect that the developers don't plan to put any emphasis on fixing bits of the tag API that don't work, but I'll be happy to read a statement to the contrary.
Carl Stanton said:when I run my custom VBA blocks elements are drawn with all tags visible
Please provide some evidence...
dgn file and an example VBA source code are attached. The relevant VBA function is also below. INSERT_TRACK.mvba
vba source code:
Public Sub AddTagDefinitions(TagSetName As String) Dim oDefs As TagDefinitions Set oTagSet = oTagSets.Add(TagSetName) 'Creating TagSets Set oDefs = oTagSet.TagDefinitions Set oTagDef = oTagSet.TagDefinitions.Add("FUN_ID", msdTagTypeCharacter) With oTagDef .IsHidden = True .IsConstant = False End With Set oTagDef = oDefs.Add("ANGLE", msdTagTypeCharacter) With oTagDef .IsHidden = True .IsConstant = False End With Set oTagDef = oDefs.Add("TSI", msdTagTypeCharacter) With oTagDef .IsHidden = True .IsConstant = False End With Set oTagDef = oDefs.Add("MISC", msdTagTypeCharacter) With oTagDef .IsHidden = True .IsConstant = False End WithEnd Sub
ctec_cad.dgnlib
Hi Carl,
I can confirm this is an open Bug # 661690 with placing tags.The workaround would be to explicitly set .IsHidden = true after attaching the tag to an element.This could be such a code example:
Set oTag = element.AddTag(oTagdef) oTag.IsHidden = True ' hide after adding tag oTag.Rewrite ' rewrite in dgn
I hope this helps?
Best regards,
Artur
Answer Verified By: Robert Hook
This appears to work, thank you very much.