×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources