| Visual Basic | |
|---|---|
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
Change Card Variables Add-in (C#)
Change Card Variables Add-in (VB.NET)
Set Part Number Using Default Serial Numbers (C#)
Set Part Number Using Default Serial Numbers (VB.NET)
Change Card Variables Add-in (VB.NET)
Set Part Number Using Default Serial Numbers (C#)
Set Part Number Using Default Serial Numbers (VB.NET)
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 that 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.
- 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.
IEdmEnumeratorVariable5 Interface
IEdmEnumeratorVariable5 Members
IEdmEnumeratorVariable10::GetVar2 Method ()
IEdmEnumeratorVariable10::GetVarAsText Method ()
IEdmEnumeratorVariable5 Members
IEdmEnumeratorVariable10::GetVar2 Method ()
IEdmEnumeratorVariable10::GetVarAsText Method ()
SOLIDWORKS PDM Professional Version 5.2