Cancel
Showing results for 
Search instead for 
Did you mean: 

BlockStyler Selection filter option to set

Pioneer
Pioneer

Hi,

 

I would like to set option to select end points of curves(Line, Spline, Arc etc) as well as existing points.

 

        PropertyList blkSelectionProperties = blockID.GetProperties();
        Selection.MaskTriple[] arrMaskForPoints = new Selection.MaskTriple[1];
        arrMaskForPoints[0].Type = NXOpen.UF.UFConstants.UF_point_type;// 2; 
        arrMaskForPoints[0].Subtype = NXOpen.UF.UFConstants.UF_point_subtype;// 0;
        arrMaskForPoints[0].SolidBodySubtype = 0;
        blkSelectionProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.ClearAndEnableSpecific, arrMaskForPoints);

 

However if i do the same as mentioned able, i cant select any end points of curves.

 

Kindly let me know how to achieve both.

 

Is it possible to set the fileter for both options If yes how?.

 

Regards,

Maddy

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4
5 REPLIES

Re: BlockStyler Selection filter option to set

Honored Contributor
Honored Contributor

I'd suggest taking a look at "SpecifyPoint".

Re: BlockStyler Selection filter option to set

Pioneer
Pioneer

Hi cowski,

 

i did tried with specify point, but selection from assembly was not possible.

 

Is there any other method to select all types of curves.

 

Regards,

Maddy

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4

Re: BlockStyler Selection filter option to set

Honored Contributor
Honored Contributor

Whoops, I meant PointSubfunction. The following code will allow you to pick curve end points, existing points, etc anywhere in the assembly. However, it only returns coordinates, it won't tell you what objects were selected (if any).

 

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module2

Public Enum SelectionType
Inferred = 0
CursorLocation = 1
Ignored2
Ignored3
ExistingPoint
EndPoint
ControlPoint
IntersectionPoint
ArcCenter
PosOnArc
Ignored10
Intersection
Quadrant
PointOnCurve
PointOnSurface
PointBetween
CursorLocation2
Ignored17
End Enum

Public Enum OffsetMode
NoOffset = 0
RectangularAbs
Ignored2
Cylindrical
Spherical
Ignored5
AlongVector
AlongCurve
End Enum

Sub Main()

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If

Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()

Const undoMarkName As String = "point subfunction"
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName)

Dim response1 As Integer = Nothing
Dim mode1() As Integer = {0, 0}
Dim pointDisplayMode As Integer = 0
Dim objectpoint(2) As Double
Dim lastView As String

Do
theUfSession.Ui.LockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
response1 = theUfSession.Ui.PointSubfunction("Select Point", mode1, pointDisplayMode, objectpoint)
theUfSession.Ui.UnlockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)

If response1 = 5 Then
lw.WriteLine("X = " & objectpoint(0).ToString & " Y = " & objectpoint(1).ToString & " Z = " & objectpoint(2).ToString)
theUfSession.Ui.AskLastPickedView(lastView)
lw.WriteLine("picked in view: " & lastView)
Dim pickMode As SelectionType = mode1(0)
Dim theOffset As OffsetMode = mode1(1)
lw.WriteLine("selection type: " & pickMode.ToString)
lw.WriteLine("offset: " & theOffset.ToString)
lw.WriteLine("")
End If

Loop Until response1 <> 5


lw.Close()

End Sub


Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module  

 

Re: BlockStyler Selection filter option to set

Siemens Phenom Siemens Phenom
Siemens Phenom

There is also Snap.UI.Input.GetPosition, though this doesn't allow you to specify how the point should be indicated (end-points, or whatever). It automatically allows points to be specified by any method.

山田
yamada

Re: BlockStyler Selection filter option to set

Creator
Creator

try turning on the point overlay

 

you can do this in the block styler or in the code with:

blockID.GetProperties.SetLogical("PointOverlay", value)

 

and then enable the snap points you want (easier in the block styler)