Cancel
Showing results for 
Search instead for 
Did you mean: 

Selection Scope - Blockstyler

Valued Contributor
Valued Contributor

Hello,

 

I was wondering if anyone had experience with changing the selection scope while using the blockstyler. The functionality I would like to achieve is best described in a brief run through. User selects button, dialog pops up, selection scope is changed to Entire Assembly, user does work, user eventually exits dialog through OK/cancel and the selection scope is changed back to whatever was present before the user selected the dialog.

 

I'm aware there is code out there which allows changing the selection scope for example:

 

        Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
         
        Dim resp As Selection.Response = theUI.SelectionManager.SelectObject(prompt, _
         title, scope, selAction, _
         includeFeatures, keepHighlighted, selectionMask_array, _
         selObj, cursor)

 However, I don't think this is an acceptable option since the selection process is already covered from the curvecollector tool in blockstyler, and from what I understand the code provided above not only changes the scope but it is essentially another selection process.

 

Is there another way?

 

Thanks,

Jgolen

NX 8.5 / 9.0

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015
7 REPLIES

Re: Selection Scope - Blockstyler

Siemens Phenom Siemens Phenom
Siemens Phenom

This can be done by setting the MaximumScope enum property on the Curve Collector block to "Entire Assembly"

Re: Selection Scope - Blockstyler

Valued Contributor
Valued Contributor

Thank you. I wonder why these options aren't present on the blockstyler help page under curve collector? Where can I find a list of these properties and values to enter?

 

Here's my first attempt at using the properties of the curve collector. 

 

Private selCrvEdg As NXOpen.BlockStyler.CurveCollector

'In the cb_initialize() method
selCrvEdg = CType(bridgeToolDlg.TopBlock.FindBlock("selCrvEdg"), NXOpen.BlockStyler.CurveCollector)

Dim propertyList as PropertyList = selCrvEdg.GetProperties()
propertyList.SetEnumAsString("MaximumScope", "Entire Assembly")

 However I am getting an exception when I try performing this code. Here is the exception details:

 

NXOpen.NXException was caught
ErrorCode=3520041
HResult=-2146232832
Message=Invalid property name for the block. See syslog for details
Source=NXOpenUI
UndoMark=0
StackTrace:

Thanks

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Selection Scope - Blockstyler

Esteemed Contributor
Esteemed Contributor

You set those in the block styler, where you create the dialog.

It is a property that you usually don't need to change at runtime.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Selection Scope - Blockstyler

Phenom
Phenom
You shouldn't need to use the PropertyList anymore. The blocks should have named methods for each property (as of NX7.5 I think). This avoids the problems with using hard coded string names.
So in your code if you type selCrvEdge. you should get a "content assist" list of the available methods.
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Selection Scope - Blockstyler

Esteemed Contributor
Esteemed Contributor

The curve selector in NX 8.5 doesn't have a maximum scope property.

You get one with the regular object selector, so you need to mask the selection manually.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Selection Scope - Blockstyler

Valued Contributor
Valued Contributor
Ah, I see what you are saying. Use the regular object selector to get the maximum scope property and then mask the selection manually.

However I'm not exactly sure what you mean by mask the selection manually. With the curvecollector I had access to properties like EntityType and CurveRules which made it very easy for selection. How would I achieve similar results with manual masking?
NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Selection Scope - Blockstyler

Esteemed Contributor
Esteemed Contributor

In dialogShown_cb you set the "selection mask" = EntityType as follows.

 

Dim oSelectionMask(0) As Selection.MaskTriple

With oSelectionMask(0)
    .Type = UF.UFConstants.UF_machining_geom_type
    .Subtype = UF.UFConstants.UF_mach_geom_feature_subtype
    .SolidBodySubtype = 0
End With

selection0.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, oSelectionMask)

 

The SetSelectionFilter is available in NX 8 and higher, since you don't need the properties list anymore starting with NX 8.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community