Hide Table of Contents
SelectedFeatureProperties Method (IModelDoc2)

Sets the property values of the selected feature.

.NET Syntax

Visual Basic (Declaration) 
Function SelectedFeatureProperties( _
   ByVal RgbColor As System.Integer, _
   ByVal Ambient As System.Double, _
   ByVal Diffuse As System.Double, _
   ByVal Specular As System.Double, _
   ByVal Shininess As System.Double, _
   ByVal Transparency As System.Double, _
   ByVal Emission As System.Double, _
   ByVal UsePartProps As System.Boolean, _
   ByVal Suppressed As System.Boolean, _
   ByVal FeatureName As System.String _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IModelDoc2
Dim RgbColor As System.Integer
Dim Ambient As System.Double
Dim Diffuse As System.Double
Dim Specular As System.Double
Dim Shininess As System.Double
Dim Transparency As System.Double
Dim Emission As System.Double
Dim UsePartProps As System.Boolean
Dim Suppressed As System.Boolean
Dim FeatureName As System.String
Dim value As System.Boolean
value = instance.SelectedFeatureProperties(RgbColor, Ambient, Diffuse, Specular, Shininess, Transparency, Emission, UsePartProps, Suppressed, FeatureName)
System.bool SelectedFeatureProperties( 
   System.int RgbColor,
   System.double Ambient,
   System.double Diffuse,
   System.double Specular,
   System.double Shininess,
   System.double Transparency,
   System.double Emission,
   System.bool UsePartProps,
   System.bool Suppressed,
   System.string FeatureName
System.bool SelectedFeatureProperties( 
&   System.int RgbColor,
&   System.double Ambient,
&   System.double Diffuse,
&   System.double Specular,
&   System.double Shininess,
&   System.double Transparency,
&   System.double Emission,
&   System.bool UsePartProps,
&   System.bool Suppressed,
&   System.String^ FeatureName


Color of feature (see Remarks)
0.0 <= Ambient value <= 1.0
0.0 < Diffuse value <= 1.0
0.0 < Specular value <= 1.0
0.0 < Shininess value <= 1.0
0.0 <= Transparency value <= 1.0
0.0 <= Emission value <= 1.0
True if the feature inherits the properties from the part, false if not
True if the feature is suppressed, false if not
Name of the feature

Return Value

True if feature's properties are successfully set, false if not



To see the RgbColor change, you must:

  1. Specify the reflectivity properties (Diffuse, Specular, Shininess (1.0 - Specular spread/Blurriness)), each with a value greater than 0.0 and less than or equal to 1.0.
  2. Specify Ambient, Transparency and Emission, each with a value between 0.0 and 1.0, inclusive.
  3. Refresh the graphics area after calling this method.

This method is different from IModelDodc2::SelectedEdgeProperties and IModelDoc2::SelectedFaceProperties in that it allows you to change the name of this feature. All features have names; however, a face or edge typically has a name only if it is being referenced. Because it is dangerous to change the name of a referenced object, you cannot programmatically change the names of faces or edges. See IFeature::Name and IPartDoc::SetEntityName for additional information.

This method requires that the feature to be selected. To select the feature programmatically, you can use IModelDocExtension::SelectByID2 and pass in the feature name and the appropriate object type (for example, "BODYFEATURE", "ATTRIBUTE", "PLANE", "SKETCH", and so on) and the selection coordinates 0,0,0. To determine the feature name and object type, use the IFeature::Name and IFeature::GetTypeName methods, respectively.



See Also


SOLIDWORKS 2001Plus FCS, Revision Number 10.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

Subject:   Feedback on Help Topics
Page:   SelectedFeatureProperties Method (IModelDoc2)
*   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:


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

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