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

Using Expressions List to Populate Dialog Box

Hi.  I have created a dialog box using Block UI Styler in NX 8.5.  In the Styler I populated the Values property for an enumeration Block Type with the options I wanted the user to be able to pick from.  After some manipulation of the .vb code that was generated the user can now select a value and the expressions dialog will reflect the change, therefore updating the parts, size, length, etc..

 

My question is if I create an expression of type list that contains the values I'd like the user to choose from, can that list populate the values in the dialog box I created?  Right now I have to go back to the Block UI Styler and change the values from there.  However, this creates a new .vb code that does not contain the lines of code I've added.  

 

I appreciate any help or suggestions, thanks! 

2 REPLIES
Solution
Solution
Accepted by topic author Salama2
‎09-22-2016 01:40 PM

Re: Using Expressions List to Populate Dialog Box

You can populate the list of values in an enum block in the initialize callback. Use the SetEnumMembers() property to specify the array of values.

Re: Using Expressions List to Populate Dialog Box

Hi,

 

In documentation says what you mention, but I cannot understand how is working.

Could you point me to a complete documentation about BlockStyler and the way to perform this kind of manupulations?

 

I saw some code in .vb with lots of lines to do something simple, pasted code with no reference about why they are there. It's frustrating -.-

 

Thanks in advance for any help!

 

void MyDialog::initialize_cb()
{
    try
    {
         opt_layer = dynamic_cast<NXOpen::BlockStyler::Enumeration*>(theDialog->TopBlock()->FindBlock("opt_layer"));

         // THIS CODE WILL RAISE AN EXCEPTION
         std::vector<NXString> layerList;
         layerList.push_back("1");
         layerList.push_back("3");
         layerList.push_back("9");
         opt_layer->SetEnumMembers(layerList);
    }
    catch(exception& ex)
    {
        //---- Enter your exception handling code here -----
        DialogImportGDSII::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
    }
}