Hide Table of Contents
ISetEntityName Method (IPartDoc)

Sets the name of the entity if the entity does not have a name.

.NET Syntax

Visual Basic (Declaration) 
Function ISetEntityName( _
   ByVal Entity As Entity, _
   ByVal StringValue As System.String _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IPartDoc
Dim Entity As Entity
Dim StringValue As System.String
Dim value As System.Boolean
 
value = instance.ISetEntityName(Entity, StringValue)
C# 
System.bool ISetEntityName( 
   Entity Entity,
   System.string StringValue
)
C++/CLI 
System.bool ISetEntityName( 
&   Entity^ Entity,
&   System.String^ StringValue
) 

Parameters

Entity
Entity  
StringValue

Name of the entity 

Return Value

True if name is set successfully, false if not

Remarks

If the entity already has a name, then this method does not change the name and returns false.

This behavior is intended to prevent a program from accidentally renaming an entity that is referenced in some other location. For example, if an assembly contains a mate to a face on a part, then a name is automatically assigned to that face. If you were to change that name, then there is no guarantee that the mate is still valid. Therefore, when using entity names, you should first check to see if the entity is already named, and, if so, use the existing name. If no name exists for the entity, then you can name the entity.

You can explicitly delete an entity name using the IPartDoc::DeleteEntityName or IPartDoc::IDeleteEntityName method. You then have the option of renaming the item or using that name elsewhere. The method was provided because the action is already available in the core SOLIDWORKS product. However, you should recognize the possibility of reference failures as described.

 

See Also



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:   ISetEntityName Method (IPartDoc)
*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) 2015 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.