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

RE: [V8i VBA] SetActiveDepthByPoint - doesn't work

$
0
0
Sub SetActiveDepth(View As Long, ElementId As DLong)

    Dim centroid As Point3d
    Dim oElement As Element
    Dim myClip As ShapeElement
    Dim activeView As View
    Dim p As Point3d
        Set oElement = ActiveModelReference.GetElementByID(ElementId)
        Set myClip = oElement.AsShapeElement
        ActiveModelReference.UnselectAllElements
        centroid = myClip.centroid
        MsgBox CStr(centroid.X)
        Set activeView = ActiveDesignFile.Views(View)
        

    activeView.SetActiveDepthByPoint centroid
    
       activeView.Redraw
       

End Sub

Thank You Jon, I will remeber about Code Syntax.

You are right about ClipId - it should be ElementId

For now code looks like this, but it's still doesn't working.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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