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

RE: [Connect update 4] Problem with TextNode Rotation

$
0
0

[quote user="Nenad Poljcic"]Here is attached dgn file[/quote]

Your text node is view independent.  It has no rotation, and is always displayed in the plane of the view.  Most elements don't give the user that option, so you will encounter it mostly with text and text nodes.  The error message you see is misleading (as well as mis-spelled). 

I created a new text node in your DGN model.  I made the text node view-dependent, and I can use your code to extract the rotation matrix successfully.

Check for a view independent text or text node before attempting to get its rotation...

Sub TestNenad1()
    Dim oElement                            As Element
    Set oElement = ActiveModelReference.GetElementByID64(3666)
    Debug.Print "Get element ID " & DLongToString(oElement.ID) & " type " & CStr(oElement.Type)
    If oElement.IsTextNodeElement Then
        Dim oNode                               As TextNodeElement
        Set oNode = oElement.AsTextNodeElement
        Dim rotation As Matrix3d
        If oNode.IsViewIndependent Then
            rotation = Matrix3dIdentity
        Else
            rotation = oNode.rotation
        End If
    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>