- I am sure you will know this answer if it is possible.
I Love your framework for creating Solidworks plug ins. I am finding my way with it. Now I want to do something fancy... I want to provide a Property Manager page where I add a control for each sheet in a Drawing. I want the user to be able to select what sheets they want to do some scripts on. Basically this means getting the sheet names on the fly and creating the property manager on the fly. I am pretty sure I could create one using the Solidworks API, I am wondering if there is a good way to create one using the framework?
SolidworksApi/macros
Hi Eric,
Although it is technically possible to build dynamic pages like this. You will need to employ .NET reflection to build dynamic types, but I would not recommend going this route.
As far as I understand you want to be able to dynamically load the list of sheets and let the user do something with those sheets based on the selection. I would recommend the following approach:
Currently, SwEx doesn't have an option to have a dynamic list in the combobox. I however currently working on a new framework called xCAD which can do this. I will eventually stop supporting SwEx and will switch to xCAD which is much more powerful framework. It will be a very easy conversion from SwEx to xCAD, so do not worry if you have some code in SwEx. I currently do not have any documentation available for xCAD but it is similar in a way to SwEx.
I have attached an example project in xCAD (just do the same restore nuget as you did before).
This has a command group with ShowPMPage button which is enabled in drawings. Once run - PMP is opened and drop-down is populated with all drawing sheets of the active document. Select the different sheets in the drop-down and click GetData button. Some information is displayed in the message box for the sheet corresponding to the selected drop-down.
Please let me know if that works for you or you have any questions.
Thanks,
Artem
- Awesome. I appreciate that. I am looking forward to the new framework.
I guess another way I could do this is to create a winform on the fly...also not awesome but well known technology. I have inserted form controls on a form at runtime. It's kinda ugly but can work. It is also a user interface outside of Solidworks so it has the potential to get hidden underneath another window and lock things up.