×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journal: Selection Filter to default?

Journal: Selection Filter to default?

Journal: Selection Filter to default?

(OP)
Hello,

How does one set the selection filter of a BlockStyler.SelectObject to default ("No Selection Filter") so that you can select any object?

This is what I have so far:

CODE -->

Dim selectionfilter(0) As MaskTriple
selectionfilter(0).Type = -1
selectionfilter(0).Subtype = -1
selection0.GetProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.ClearAndEnableSpecific, selectionfilter) 

However, this disables the selection filter.

Is there a solution?

NX10.0 Win8.1 64bit i7-3770K 16GB Quadro2000

RE: Journal: Selection Filter to default?

selection0.GetProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.EnableAll, ...

RE: Journal: Selection Filter to default?

(OP)
Hi BubbaK,

I tried that, but it fails.

CODE -->

Dim selectionfilter(0) As MaskTriple
selection0.GetProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.EnableAll, selectionfilter) 

NX shows an error dialog with "NXOpen.NXException: Second parameter is invalid"
The log shows "+++ Cannot specify mask_triples if action is enable all"

So I tried this

CODE -->

selection0.GetProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.EnableAll, Nothing) 

but the same error occurs.

NX10.0 Win8.1 64bit i7-3770K 16GB Quadro2000

RE: Journal: Selection Filter to default?

CNZSU,

You have the parameters in SetSelectionFilter mixed up.

The second is SelectionAction but you have put the selectionFilter in there. You need to put EnableAll in the third parameter.

Paul

Paul Turner
CAD & Process Engineer
Mastip Technology

RE: Journal: Selection Filter to default?

(OP)
They're not mixed up, otherwise the code wouldn't even build in visual studio.

The strange thing is that all selection actions work, except EnableAll.

I could do selection0.ResetFilter() , and that will enable most of the object types, but not Sketch.

Here's the workaround:

CODE -->

Dim selectionfilter(0) As MaskTriple
selectionfilter(0).Type = NXOpen.UF.UFConstants.UF_sketch_type
selectionfilter(0).Subtype = NXOpen.UF.UFConstants.UF_all_subtype
selection0.ResetFilter()
selection0.SetSelectionFilter(SelectionAction.EnableSpecific, selectionfilter) 

This will reset the selection filter (to enable most object types) and add the Sketch object type to the filter, which adequately solves my problem.

NX10.0 Win8.1 64bit i7-3770K 16GB QuadroK2200

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources