Home Search

DriveWorks Pro 20
Set Global Variable

Send Feedback
This Task is now core functionality, please see Set Global Variable

Set Global Variable - SOLIDWORKS PowerPack

Will set the value or equation of an existing Global Variable.

Properties

Property NameDescription
(Name)The unique name for this task.
Global Variable NameThe name of the existing Global Variable you want to edit.
Global Variable Value/EquationThe value or equation to set the Global Variable to.

Limitations

The Set Global Variable Generation Task will not be executed if:

  • The 'Global Variable Name' property is left blank.
  • There is no Global Variable with the name defined by the 'Global Variable Name' Property in the driven part or assembly.
  • The 'Global Variable Value/Equation' Property is left blank.
  • The Global Variable you wish to drive scopes one or more specific configurations. The current Task works with Global Variables scoping all configurations only.

Example Property Values

The following table shows examples of the ‘Global Variable Name’ and ‘Global Variable Value/Equation’ Properties and their results.

DriveWorks 'Global Variable Name' PropertyDriveWorks ‘Global Variable Value/Equation' PropertyResult
MyGlobalVariable123The existing Global Variable called "MyGlobalVariable" will have its Value/Equation set to 123
MyGlobalVariable3.14The existing Global Variable called "MyGlobalVariable" will have its Value/Equation set to 3.14
MyGlobalVariable="17mm"The existing Global Variable called "MyGlobalVariable" will have its Value/Equation set to 17mm
MyGlobalVariable="""MyOtherGlobalVariable"" * 5"The existing Global Variable called "MyGlobalVariable" will have its Value/Equation set to "MyOtherGlobalVariable"*2, granted that the Global Variable called MyOtherGlobalVariable does exist in the current model.

How to build rules to use other Global Variables in the 'Global Variable Value/Equation' property

In SOLIDWORKS, if you want the value of a Global Variable called A to be twice the value of a Global Variable called B then this is what you would see in the SOLIDWORKS equation manager:

The Value/Equation of the Global Variable A is set to ="B"*2.

To build this rule in DriveWorks you need to build a string that results in "B"*2.

To do so, you have to use what is called escaping double quotes.

The rule you would have to build in DriveWorks would then be """B""*2".

This would look like this in the property editor:

And it would look like this in the rule builder: