Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 787

SelectObjects: Warning if range is smaller then given one

$
0
0

Hello at all,

I have a problem with my SelectObjects function. I want to select various drilling holes, but if I the distance between the centre of the holes are smaller than a given a range, I want to get a warning. Important is that we select the circle of the holes and not the centre.
For example:
Hole1 have to be minimum 100 mm away from Hole2
Hole2 have to be minimum 100 mm away from Hole3
But it isn't important which distance is between Hole1 and Hole3

I didn't found anything by now for putting conditions in the SelectObjects function and also having a problem in getting the distance between two centres by only choosing the holes.

If SelectObjects("Select holes",
                       mySelectedObjects) = Selection.Response.Ok Then
 
'...
 
    Function SelectObjects(prompt As String,
               ByRef selObj As NXObject()) As Selection.Response
 
        Dim theUI As UI = UI.GetUI
 
        'only choose edges
 
        Dim typeArray() As Selection.SelectionType =
            {Selection.SelectionType.Edges}
 
        Dim resp As Selection.Response = theUI.SelectionManager.SelectTaggedObjects(
                prompt, "Selection",
                Selection.SelectionScope.AnyInAssembly,
                False, typeArray, selObj)
 
        If resp = Selection.Response.ObjectSelected Or
                resp = Selection.Response.ObjectSelectedByName Or
                resp = Selection.Response.OK Then
            Return Selection.Response.Ok
        Else
            Return Selection.Response.Cancel
        End If
 
    End Function

Thanks already for any help


Viewing all articles
Browse latest Browse all 787


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>