Hi,
I have made one block in part and then created view of that part in drawing.
Now I am trying to get co-ordinates value with respect to that particular view when user will select screen position in that view.
I am able to get point co-ordinates with respect to drawing.
By using below code i am able to get origin of activated view.
Module Module1
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim theUI As UI = UI.GetUI
Sub Main()
Dim X, Xx, Y, Z As Double
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If
Dim dwgsheet As Drawings.DrawingSheet
dwgsheet = workPart.DrawingSheets.CurrentDrawingSheet
For Each View As Drawings.DraftingView In dwgsheet.SheetDraftingViews
If View.IsActiveForSketching = True Then
X = View.AbsoluteOrigin.X
Y = View.AbsoluteOrigin.Y
Z = View.AbsoluteOrigin.Z
' MsgBox(CStr(X))
MsgBox(CStr(Xx))
End If
Next
End Sub
End Module
re: coordinate of view
I'm not quite clear on what you are after. After selecting a point in a drafting view, do you want the coordinate with respect to the drawing sheet or the absolute modeling space?