I am currently building a rather complex UI for NX12.
I figured that BlockStyler has limitations and the Code behing would be rather complex when it comes to updating and handling the UI. Maybe I am just doing this wrong.
So tried to add this as a WinForm or WPF which worked. But I couldn't figure out how to implement a BodyPicker and FacePicker. For example in my BlockStylerUI I implemented a PointPicker, the user can select a point on any surface and a specific feature will be added to this coordinates.
I have two questions:
Solved! Go to Solution.
I never felt diffcult to use UI block styler for complex UI. Block styler can able to handle all NX functionalities.
If you are using WinForm and need to select a point or face try ufunc wrapper functions. They may help you.
If your application is only with NX, I suggest to use NX block styler.
Tell us about your complex UI.
I agree, I've created some pretty complicated dialogs with Blockstyler...
Every dialog added to NX in the past ten years or so uses Block Styler. Is your UI more complex than all those dialogs? Probably not.
If you use WinForms, then you'll have to do a lot of work to get your UI to look and behave like the rest of NX. You'll have problems with things like selecting objects, selection pre-highlighting, specifying point locations, etc.
If your functions doesn't do any interaction in the graphics window, and you don't have a Block Styler license, then using a WinForm might be appropriate. Otherwise, I'd strongly suggest that you use Block Styler. You might have to write a lot of code in callback functions to get the behaviour you want, but this code wouldn't be any simpler with a WinForm, would it?
Posting an image of your dialog would help to suggest how to do things in a simple manner.
Production: NX12.0.2, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX (1876) | AWC 3.4 Preparing: -
Employees of the customers, together we are strong
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide
maybe I should have provided more informations, sorry about that.
I bascially have two bigger issues where I have the feeling that im doing it not in the best way:
I was struggling with the placement and order of the blocks.
For example I was not able to have two columns of enums with the same size. Or change the size of a specific element in its height and width.
As a workaround I used Group-Block without a header, its still not that good, but it gets closer to what I want to achive.
I have multiple Listboxes, Enums, etc that will be filled from a (for now local) database.
As a example: The available selections of Listbox2 is changed everytime you change the selection of Listbox1.
I haven't found a better way than structuring my code like this:
ExampleUI (this one comes from BlockStyler)
I made this a partial class to have the population of the UI handled in a different file for better reading.
Populate (partial class from ExampleUI)
In here I will read from the databases and populate all the blocks.
Commands (partial class from ExampleUI)
Same as the Populate but this one contains all the Buttonroutines.
SelectionChanged (partial class from ExampleUI)
This one will re-populate / filter the UI according to the selection changes of each single block.
My main thought about that structure was an "easy-to-maintain" code whenever you change the design of the BlockStyler or the Database. All sub-partical-classes will call regluar classes to handle the single actions.
You can get pretty much what you want just using block attachments, see the attached example dialog:
Is that any good?
Some more information about how I've forced the layout of Block dialogs in the past can be seen in these posts:
Hope this helps.
that helped me alot. Do you have any suggestion how how to make the code architecture?
I am currently trying to split it with partial classes to achive a better maintainability, but I am not happy with this solution.
I changed the Code and made separate classes for each group of controls and pass the BlockStylerItems into the class.
That way I can maintain each single group easily and I have a good structured code.
I'm not sure what language you're using, but I guess VB or C#, which I'm not really familiar with. We're using Java which has very different structure and requirements. I've heard of others creating partial classes (in C# I think), but thats not possible in Java, so we've come up with another solution that does not use the code generated by Blockstyler at all.
The only thing I should say is do not use the code generated by Blockstyler directly, always make a copy because if you edit the dialog in Blockstyler and save it, it will overwrite the source code too and you'll lose all of your edits.