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

BlockStyler: init SpecifyPoint to previously selected point

I have a BlockStyler dialog for a Contructor. This contains a Point Select element.

 

Creating my object (a Custom Feature, but that shouldn't matter for this question) is all good. I select a point, in the code i get that point from the Point Select, I use it.

 

My problem appears when I open the obejct later to edit its parameters. Then I want to init the BlockStyler GUI to the current settings of the object. I do this in the initialize_cb of the UI element. This works fine for the expressions, but not for the point.

 

If the point is an existing point (i.e. selected using "Existing Point"), it does work. But if it is a geometry point, says an edge vertex, selected through Inferred Point or End Point, setting the SpecifyPoint using its SetSelectedObejcts method does not raise an error, but the selection is still empty.

 

The point being an NXOpen.Point, i.e. a smart object, I assume it must know its Selection Rule and its parent, else it could not be associative, but it does not seem to transmit those to the Select Object GUI element.

 

I could not find any other functions for setting the selected objects in the docs

 

Does anyone know if I am doing something wrong, or if that is maybe a bug?

 

Using Python in NX 11.0.1.11 MP1

6 REPLIES

Re: BlockStyler: init SpecifyPoint to previously selected point

Just found out that is DOES reappear if i click the "reset" button in the BlockStyler GUI.

 

But the Point Selector does not have a RetainValue property, so setting that to False is not an option.

And I don't see a reset function in NXOpen.BlockStyler.BlockDialog

 

So I am still looking for a solution.

Re: BlockStyler: init SpecifyPoint to previously selected point

Try this.

 

In the initialize_cb, define an empty TaggedObject array and assign it to SetSelectedObjects.  That should reset the dialog.

Re: BlockStyler: init SpecifyPoint to previously selected point

Thanks!

 

Unfortunately, that did not make a difference.

 

I also tried setting it to the NXOpen.TaggedObject.Null, which also did not help, and setting its Enable to False and back to True.

 

It really seems to depend on the setting of the point type dropdown right before - he seems to keep that setting as per RetainValue, and if it is not the correct on, he does not display the point. But if I check GetSelectedObjects right after setting it, it is there. Trouble is, the GUI Block does not know that, and thus does not allow the user to click ok.

 

Seems more and more like it's just a bug - but a bug in some pretty basic functionality.

 

Solution
Solution
Accepted by topic author NikolasGoldin
‎03-31-2017 07:30 AM

Re: BlockStyler: init SpecifyPoint to previously selected point

I think you should set the point in the dialogshown_cb.

Re: BlockStyler: init SpecifyPoint to previously selected point

Thank you, that did it!

Re: BlockStyler: init SpecifyPoint to previously selected point

For anyone else dealing with this:

 

Another solution is creating the Dialog in edit mode.