SOLIDWORKS PDM Professional API Help Send Feedback
SetValEx Method (IEdmTaskProperties)
See Also  Example
EPDM.Interop.epdm Namespace > IEdmTaskProperties Interface : SetValEx Method (IEdmTaskProperties)


bsValName
Name of the user-defined variable for which to set a value
oValue
Value of user-defined variable (see Remarks)
Sets a value for the specified user-defined variable.

Syntax

Visual Basic 
Sub SetValEx( _
   ByVal bsValName As System.String, _
   ByVal oValue As System.Object _
) 
C# 
void SetValEx( 
   System.string bsValName,
   System.object oValue
)
C++/CLI 
void SetValEx( 
&   System.String^ bsValName,
&   System.Object^ oValue
) 

Parameters

bsValName
Name of the user-defined variable for which to set a value
oValue
Value of user-defined variable (see Remarks)

Example

Remarks

Call this method:

  • to store variable data entered by the user in the task definition setup page on the client machine. 
  • during the processing of the EdmCmdType.EdmCmd_TaskSetup hook.

Custom data types and objects must be serialized to a string, numeric type, or date before calling this method. For example:

  1. Serialize the object data to XML or JSON using StringBuilder, XmlWriter, XmlSerializer, etc.
  2. Call IEdmTaskProperites::SetValEx to store the resulting string.
  3. Call IEdmTaskProperties::GetValEx to retrieve the stored string.
  4. Initialize the new instance of the object from XML/JSON using StringReader, XmlReader, XmlSerializer, etc.

To get the user-defined values when the task is executing on the server, call IEdmTaskInstance::GetValEx during the processing of the EdmCmdType.EdmCmd_TaskRun hook.

NOTE: The difference between this method and IEdmTaskProperties::SetVar is that the latter requires a pre-defined card variable in the vault, whereas this method does not.

Return codes:

  • S_OK: The method successfully executed.
 

See Also

Availability

SOLIDWORKS PDM Professional 2010