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

RE: Attributes Bylevel in VBA

$
0
0

[quote user="Xavi García Maranges"]Is there any way to find the attributes of a element ( that are defined Bylevel , value -1) without know the level_name or level_code?[/quote]

An element's symbology is either explicit or ByLevel.  If style, weight or colour is explicit then the information is available directly from the element.

If style, weight or colour is ByLevel then you must obtain that attribute from the element's level definition.  It gets even more complicated when you consider that an element's appearance can be modified by view display settings...

Sub TraceSymbology (ByVal oElement As Element, ByVal oView As View)
  Dim msg As String
  If oElement.IsGraphical Then
    Dim oLevel As Level
    Set oLevel = oElement.Level
    msg = "Element ID " & DLongToString (oElement.ID) & " level '" & oLevel & "'"
    ShowMessage msg, msg, msdMessageCenterPriorityDebug, False
    Dim colour As Long
    colour = oElement.ApparentColor (oView)
    Dim oStyle As Style
    Set oStyle = oElement.ApparentStyle (oView)
    Dim weight As Long
    weight = oElement.ApparentWeight(oView)
    msg = "Colour " & CStr(colour) & " Weight " & CStr(weight) & " Style '" & oStyle.Name & "'"
ShowMessage msg, msg, msdMessageCenterPriorityDebug, False Else msg = "Element ID " & DLongToString (oElement.ID) & " is not graphical and has no symbology" ShowMessage msg, msg, msdMessageCenterPriorityWarning, False End If End Sub


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>