Hide Table of Contents
SetVar Method (IEdmEnumeratorVariable5)

Sets the value of the specified variable in this file or folder.

Syntax

Visual Basic (Declaration) 
Sub SetVar( _
   ByVal bsVarName As System.String, _
   ByVal bsCfgName As System.String, _
   ByRef poValue As System.Object, _
   Optional ByVal bOnlyIfPartOfCard As System.Boolean _
) 
C# 
void SetVar( 
   System.string bsVarName,
   System.string bsCfgName,
   ref System.object poValue,
   System.bool bOnlyIfPartOfCard
)
C++/CLI 
void SetVar( 
&   System.String^ bsVarName,
&   System.String^ bsCfgName,
&   System.Object^% poValue,
&   System.bool bOnlyIfPartOfCard
) 

Parameters

bsVarName
Name of variable to write
bsCfgName
Name of configuration or layout to which to store the variable value; empty string for folders and file types that do not support configurations
poValue
Variable value
bOnlyIfPartOfCard
True to store the variable only if it is part of the file or folder data card, false to store the variable as hidden data if it is not part of the file or folder data card

Example

Remarks

To specify bsCfgName:

  • Call IEdmFile5::GetConfigurations to get the available configuration names for this file.
  • If this method is used in your add-in's implementation of IEdmAddIn5::OnCmd, then a list of configuration names for the data card is returned in ppoData which can be cast to EdmCmdData. EdmCmdData.mpoExtra contains an IEdmStrLst5 of configuration names.

After calling this method to update the variables that can be updated, you must call IEdmEnumeratorVariable5::Flush or IEdmEnumeratorVariable8::CloseFile with the bFlush argument set to true in order to ensure that the changes are saved properly to the file or folder.

Return codes:

  • S_OK: The method successfully executed.
  • S_FALSE: The variable was not found, and bOnlyIfPartOfCard is true.
  • E_EDM_FILE_NOT_LOCKED_BY_YOU: The file is not checked out.
 

See Also

Availability

SolidWorks Enterprise PDM Version 5.2


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:   SetVar Method (IEdmEnumeratorVariable5)
*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) 2014 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.