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 SubThank 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.