Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

This testingmotioncallback GTAC revised journal works only on TOP view

Status
Not open for further replies.

Ehaviv

Computer
Jul 2, 2003
1,012
Hi

Can someone help in make this journal for peaking rect screen coordinates
and not 3d screen coordinates

Thaniks in advanced

The revised GTAC code

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module testing_motion_callback_x4_DisplayOgpLine

Public s As Session = Session.GetSession()
Public ufs As UFSession = UFSession.GetUFSession()
Public lw As ListingWindow = s.ListingWindow

Dim screen_pos(2) As Double
dim firsCall As Boolean

Sub Main()

Dim message As String = "Testing Motion Callback"
'Dim screen_pos(2) As Double
Dim viewTag As Tag = s.Parts.Display.Views.WorkView.Tag
Dim response As Integer = 0
Dim motion_cb_data As System.IntPtr
Dim client_data As System.IntPtr = Nothing

ufs.UI.LockUGAccess(ufconstants.UF_UI_FROM_CUSTOM)

firsCall = True

ufs.Ui.SpecifyScreenPosition(message, AddressOf my_motion_cb, _
motion_cb_data, screen_pos, viewTag, response)

firsCall = False

ufs.Ui.SpecifyScreenPosition(message, AddressOf my_motion_cb, _
motion_cb_data, screen_pos, viewTag, response)

ufs.UI.UnLockUGAccess(ufconstants.UF_UI_FROM_CUSTOM)

End Sub

Public Sub my_motion_cb(ByVal current_pos() As Double, _
ByRef mtn_cb_data As UFUi.MotionCbData, _
ByVal client_data As System.IntPtr)

Dim x0y0() As Double ' = {1, 0, 0}
Dim x1y0() As Double
Dim x0y1() As Double
Dim x1y1() As Double

Dim theView As Tag = mtn_cb_data.view_tag

If firsCall Then
ufs.Disp.DisplayOgpLine(theView, current_pos, current_pos)
Else
x0y0 = screen_pos
x1y0 = { current_pos(0),screen_pos(1),current_pos(2)}
x0y1 = { screen_pos(0),current_pos(1),current_pos(2)}
x1y1 = current_pos

ufs.Disp.DisplayOgpLine(theView, x0y0, x1y0)
ufs.Disp.DisplayOgpLine(theView, x0y0, x0y1)
ufs.Disp.DisplayOgpLine(theView, x1y0, x1y1)
ufs.Disp.DisplayOgpLine(theView, x0y1, x1y1)
End If

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

Return Session.LibraryUnloadOption.Immediately

End Function

End Module





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor