I have implemented IPropertyManagerPage2Handler3 like somebody did it in SW Example
public PMPageHandler (ISldWorks swApplication) { swApp = swApplication; }
In User PMPage (named as PMPUserPage)
public class PMPUserPage { IPropertyManagerPage2 swPropertyPage; PMPageHandler handler;
IPropertyManagerPageButton button1; public const int button1ID = 0;
ISldWorks swApp; public PMPUserPage(ISldWorks swApplication) { swApp = swApplication; CreatePropertyManagerPage(); } protected void CreatePropertyManagerPage() { int errors = -1; int options = (int)SwConst.swPropertyManagerPageOptions_e.swPropertyManagerOptions_OkayButton | (int)SwConst.swPropertyManagerPageOptions_e.swPropertyManagerOptions_CancelButton; handler = new PMPageHandler(swApp);
swPropertyPage = (IPropertyManagerPage2)swApp.CreatePropertyManagerPage("Title", options, handler, ref errors); AddControls(); this.Show(); }
So, when it runs then on line (3rd from down) with (swPropertyPage = (Iproperty...) i get "Specified cast is not valid." It's a problem with handler, when i set handler=null then my property page will be shown in SolidWorks document. What am I doing wrong? Should I also implement ISwAddin?
Thanks in advance.