Hide Table of Contents
OnSubmitSelection Method (IPropertyManagerPage2Handler9)

Called when a selection is made, which allows the add-in to accept or reject the selection.

.NET Syntax

Visual Basic (Declaration) 
Function OnSubmitSelection( _
   ByVal Id As System.Integer, _
   ByVal Selection As System.Object, _
   ByVal SelType As System.Integer, _
   ByRef ItemText As System.String _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IPropertyManagerPage2Handler9
Dim Id As System.Integer
Dim Selection As System.Object
Dim SelType As System.Integer
Dim ItemText As System.String
Dim value As System.Boolean
 
value = instance.OnSubmitSelection(Id, Selection, SelType, ItemText)
C# 
System.bool OnSubmitSelection( 
   System.int Id,
   System.object Selection,
   System.int SelType,
   out System.string ItemText
)
C++/CLI 
System.bool OnSubmitSelection( 
&   System.int Id,
&   System.Object^ Selection,
&   System.int SelType,
&   [Out] System.String^ ItemText
) 

Parameters

Id
ID of the active selection box, where this selection is being made
Selection
Object being selected
SelType
Entity type of the selection as defined in swSelectType_e
ItemText
Item for selection list box (see Remarks)

Example

Remarks

If writing a macro, you must set this method to true for the user to select something (see the examples). If this method is not set to true, then the user cannot select anything. This method is set to false by default.

This method is called by SolidWorks when an add-in has a PropertyManager page displayed and a selection is made that passes the selection filter criteria set up for a selection list box. The add-in can then:

 

  • Take the Dispatch pointer and the selection type.
  • QueryInterface the Dispatch pointer to get the specific interface.
  • Use APIs of that interface to determine if the selection should be allowed or not.  
    • If the selection is accepted, return True, and processing will continue normally.

      - or -
       

    • If the selection is rejected, return false, and SolidWorks will not accept the selection, just as if the selection did not pass the selection filter criteria of the selection list box.  

The add-in should not Release() the Dispatch pointer. SolidWorks will Release() the Dispatch pointer upon return from this method.

 

The method is called during the process of SolidWorks selection. It is neither a pre-notification nor post-notification. The add-in should not be taking any action that might affect the model or the selection list. The add-in should only be querying information and then returning true/VARIANT_TRUE or false/VARIANT_FALSE.

 

ItemText is returned to SolidWorks and stored on the selected object and can be used by your PropertyManager page selection list boxes for the life of that selection.

 

See Also

Availability

Solidworks 2012 FCS, Revision Number 20.0


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.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   OnSubmitSelection Method (IPropertyManagerPage2Handler9)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:




x

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.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2013 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.