Home Search

DriveWorks Pro 21
Set Global Variable

Send Feedback

Set Global Variable

Updates the value or equation of an existing Global Variable, or creates it if it does not exist.

Properties

Property NameDescription
(Name)The unique name for this task.
NameThe name of the existing Global Variable to set.
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.
  • 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

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"*5, 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:

Generation Sequence

This Task can be added to SOLIDWORKS Parts and Assemblies in the following Generation Sequence(s):

  • Pre Drive (will be run before the Main Drive Sequence)
  • Post Drive (will be run after the Main Drive Sequence)
  • Pre Close (will be run before the SOLIDWORKS file is closed)