Tags do not hide when created with VBA in CONNECT Edition

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? 

Parents
  • 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. 

    when I run my custom VBA blocks elements are drawn with all tags visible

    Please provide some evidence...

    • A DGN file that includes your tag defs
    • VBA function source code that creates tag elements

     
    Regards, Jon Summers
    LA Solutions

  • 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 With
    End 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 

Reply Children