Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [V8i VBA] Tagdefintionname checking with Select Case statement

$
0
0

[quote user="Barry Lothian"]My guess is the AsTagElement.TagDefinitionName part of the select case line[/quote]

Good guess!  Once you've found a LineElement having tags, you then need to analyse the tags attached to that line.

Use Element.GetTags to get an array of tags from your LineElement.  The array will contain all tags attached to your line, so you need to filter those tags to find those of interest.  Use TagElement.TagSetName to get the set name from each tag, then check against your list of tag set names.

I would write a function something like this...

'  Test a tag to see if it belongs to one of an array of tag set names
Function IsInterestingTag (ByVal oTag As TagElement, ByRef setNames() As String, ByVal nSets As Long) As Boolean
  IsInterestingTag = False
  Dim i As Long
  For i = 0 To nSets - 1
    If 0 = StrComp (oTag.TagSetName, setNames(i), vbTextCompare) Then
      IsInterestingTag = True
      Exit For
    End If
  Next i
End Function

Viewing all articles
Browse latest Browse all 7260

Trending Articles