Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Get Co-Ordinate Of Activated View With Respect To That View ?

Status
Not open for further replies.

bss2311

Automotive
Dec 23, 2016
1
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

'Seclect screen position
'Dim myPoint_1 As Point3d
'Dim response1 As Selection.DialogResponse = UserSelectScreenPos("Select First corner .......", myPoint_1)
'If response1 <> Selection.DialogResponse.Pick Then
' Return
'End If

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
 
 http://files.engineering.com/getfile.aspx?folder=d60d48bb-2315-4b88-b277-90b17b5b4890&file=Image.JPG
Status
Not open for further replies.

Part and Inventory Search

Sponsor