Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Ask the User to Select a Curve with "Feature Curves" Selection Intent

Hello there,

 

I am trying to create an engraving operation with journal. In this operation, Curve/Point Drive method is used. When selecting the curve, the "Feature Curves" Selection Intent is used.

 

Now I am trying to pop up a dialog in the journal, and ask the user to select the curve with "Feature Curves" Selection Intent on. It seems that this selection intent is available only when you are inside the operation. 

 

How can I pop up this dialog in the journal?

 

Thanks,

Kai

12 REPLIES

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Can you set the intent yourself in the journal? I can record and play back a journal that set the intent to feature curves:

Dim features1(0) As NXOpen.Features.Feature
Dim text1 As NXOpen.Features.Text = CType(workPart.Features.FindObject("TEXT(4)"), NXOpen.Features.Text)

features1(0) = text1
Dim curveFeatureRule1 As NXOpen.CurveFeatureRule = Nothing
curveFeatureRule1 = workPart.ScRuleFactory.CreateRuleCurveFeature(features1)

section1.AllowSelfIntersection(True)

Dim rules1(0) As NXOpen.SelectionIntentRule
rules1(0) = curveFeatureRule1
Dim spline1 As NXOpen.Spline = CType(text1.FindObject("CURVE 5 {9 (4.9354520624719,-0.2537197431974,0.1)}"), NXOpen.Spline)

Dim nullNXOpen_NXObject As NXOpen.NXObject = Nothing

Dim helpPoint1 As NXOpen.Point3d = New NXOpen.Point3d(4.9242156261752967, -0.50965775760227028, 0.1000000000000002)
section1.AddToSection(rules1, spline1, nullNXOpen_NXObject, nullNXOpen_NXObject, helpPoint1, NXOpen.Section.Mode.Create, False)
Mark Rief
Retired Siemens

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Hello Mark,

 

I have also recorded a journal myself. But I want to pop up a window and let the user select a curve with "Feature Curves" selection intent.

 

Is that possible to do?

 

Thanks,

Kai

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

 

You can easily do this if you have access to the Block UI Styler. 

 

Create a new dialog.

 

Add a CurveCollector block.

 

Modify the "CurveRules" property so that Feature Curves are allowed.

 

Modify the "DefaultCurveRules" so that Feature Curves are specified.

 

Save your dialog.  Build your code.  Run the .DLL.  When the dialog appears, and Select Curve block has focus, the selection intent should be set to Feature Curves.

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Try the following:

 

  • Create a SelectObject block with BlockStyler
  • Set a filter so the selection objects accepts only curves and features
  • If the user select a feature, convert it to curves using the selectionintent rule
  • Remove the feature from the selection
  • Add the curves you obtain to the selection.

 

So at no time, you will have a feature in the selection, but only curves. If the user select a feature, it is automatically converted to curves in the update callback of the selection block.

 

Regards,

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

SetCurveRules function takes a int. Where can we found the corresponding int for Feature Rule ?

SetDefaultCurveRules function takes a string. Where can we found the corresponding string for Feature Rule ?

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Ok it is a bit and can be selected in the blockstyler application.

Thanks.

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

RIght - that's the quick & easy way!

 

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Hello Steve,

 

I am not very experienced in this. Is there a tutorial showing how to use the Block UI Styler?

 

Thanks,

Kai

Re: Ask the User to Select a Curve with "Feature Curves" Selection Intent

Hello Steve,

 

I just found we don't have NX/Open User Interface Styler development license right now. 

 

Is there another way to do it?

 

Thanks,

Kai