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!

i need a journal such a way that it ask me for selecting the DATUM Plane

Status
Not open for further replies.

rajesha24

Automotive
Mar 26, 2014
11
Hi

I recorded a Journal but in that selecting the Datum plane was also automatic but I need the Journal to ask the user for selecting the Datum Plane

Thanks in advance
 
Replies continue below

Recommended for you

Search this forum for "Journal Plane Selection". The first one contains what I think you are looking for.
 
Hi

I could not find it can you please send me the link for that post

Thanks
 
i want a journal such a way that it will ask for the user to select the Datuma plane and then it will start sketch in that datum plan
 
Hi

I got the code now can you please tell me how to put the user input datum plane in the below code line

Dim datumPlane1 As DatumPlane = CType(workPart.Datums.FindObject("DATUM_CSYS(0) XZ plane"), DatumPlane)

thanks
 
I'm not very good at explaining these things but hopefully the code below will help. your line is hi-lited in yellow

Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.UF

Module PointCloudTools2
Dim s As Session = Session.GetSession()
Dim ui As UI = UI.GetUI()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = s.ListingWindow
Dim wp As Part = s.Parts.Work
Sub Main()
Dim response As Selection.Response = Nothing
Dim dplane1 As DatumPlane = Nothing
Dim lw As ListingWindow = s.ListingWindow

[highlight #EF2929] response = selectDatumPlane(dplane1)
If response = Selection.Response.Cancel Or response = Selection.Response.Back _
Then GoTo End1[/highlight]


[highlight #FCE94F] Dim datumPlane1 As DatumPlane = dplane1[/highlight]

lw.Open
lw.WriteLine(datumPlane1.Layer.ToString)
lw.Close

End1:
End Sub
Function selectDatumPlane(ByRef object1 As DatumPlane) As Selection.Response
Dim selectionMask_array(0) As Selection.MaskTriple
selectionMask_array(0).Type = UFConstants.UF_datum_plane_type
selectionMask_array(0).Subtype = 0
selectionMask_array(0).SolidBodySubtype = 0
Dim cursor As Point3d = Nothing
Dim resp As Selection.Response = _
ui.SelectionManager.SelectTaggedObject("Datum Plane Selection", "Select a DatumPlane", _
Selection.SelectionScope.WorkPart, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, selectionMask_array, object1, cursor)
If resp = Selection.Response.ObjectSelected Or _
resp = Selection.Response.ObjectSelectedByName Then
Return Selection.Response.Ok
ElseIf resp = Selection.Response.Back Then
Return Selection.Response.Back
ElseIf resp = Selection.Response.Cancel Then
Return Selection.Response.Cancel
End If
End Function

End Module
 
The "Getting Started with SNAP" guide has a section on this. Just search the document for "FindObject"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor