Sub OnClose( _
ByVal Reason As Integer _
Dim instance As IPropertyManagerPage2Handler5
Dim Reason As Integer
& int Reason
Reason this method is called as defined in swPropertyManagerPageCloseReasons_e
This handler method is called when the PropertyManager page is about to close.
SolidWorks controls when add-ins can do work. An add-in is unable to do any real work within the PropertyManager2Handler5::OnClose handler because the PropertyManager page and command are closing. So, typically the IPropertyPage2Handler5::AfterClose handler is called after IPropertyManager2Handler5::OnClose to allow an add-in to do work. However:
If PropertyManager page is...
And you implemented the handler in...
Can prevent the PropertyManager page from closing by setting the HRESULT return value to S_false.
Should use the Err.Raise method with a value of 1 to prevent the PropertyManager page from closing. In VB.NET, use 0 with Err.Raise.
NOTE: When control returns to SolidWorks:
The IPropertyManager page remains displayed on the screen.
The IPropertyManagerPage2Handler5::AfterClose handler is not called.
C++ or Visual Basic
Set HRESULT to S_false to close the PropertyManager page (i.e., ignore the fact that the page is pinned).
This allows your add-in to call the IPropertyManagerPage2Handler5::AfterClose handler and do its work. To avoid aggravating your user, who expected the PropertyManager page to remain pinned, you should re-display and re-pin the PropertyManager page after the add-in finishes its work.
NOTE: In a previous version of this method, IPropertyManagerPage2Handler3::OnClose, if the user clicked the Cancel button and the PropertyManager page had a pushpin, then this method returned swPropertyManagerPageClose_Closed. This version of this method returns swPropertyManagerPageClose_Cancel in this scenario.
Provide feedback on this topic
SolidWorks welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.
We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.
Web Help Content Version: API Help (English only) 2012 SP05
The search functionality within the web help is in a beta test phase and you may experience periodic delays or interruptions in its performance. These are the normal and ordinary features of a beta test and shall not under any circumstances give rise to any liability on the part of DS SolidWorks or its licensors. The topics within the Web-based help are not beta topics; they document API Help (English only) 2012 SP05.
To disable Web help from within SolidWorks and use local help instead, click Help > Use SolidWorks Web Help.
To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.
Get a Product Demo
Get a Quote
© 1995-2013 Dassault Systèmes. All rights reserved.