Home Search

DriveWorks Solo 22
MyNumber

Send Feedback

MyNumber

Gets the specified number from within the owners name.

The maximum integer that can be extracted from an owner is 253 (9007199254740992).

Syntax

MyNumber([Index])

Where:

Index (optional) is the index specifying which number to return.

When Index is used:
  • A positive number will count the part to return from the left
  • a negative number will count the part to return from the right
  • When no index is specified an index of 1 will be used

Examples used in a Variable

The table below shows the result of the MyNumber function when applied to a Variable that includes a number in its name.

Owners NameRuleResult
DWVariableMyVar123Test45Test6MyNumber(1)123
DWVariableMyVar123Test45Test6MyNumber(2)45
DWVariableMyVar123Test45Test6MyNumber(3)6
DWVariableMyVar123Test45Test6MyNumber(-3)123
DWVariableMyVar123Test45Test6MyNumber(-2)45
DWVariableMyVar123Test45Test6MyNumber(-1)6

Please note how the index of the number can be supplied by a positive and negative value.

Numbers are treated as multi digit values if adjacent to one another.

Examples used in Model Rules

The table below shows the result of the MyNumber function when applied to various Model Rules.

Owners NameRuleResult
Assem1\Part35A\Name

(This owners name is typically the File Name parameter of a captured model.)

MyNumber(2)35
Assem1\Part35A\Name

(This owners name is typically the File Name parameter of a captured model.)

MyNumber(-2)1
Assem1\Part35A-4

(This owners name is typically the Instance number of a captured instance.)

MyNumber(-1)4

The first number from the right of the owners name.

See Also

The function Indirect can be used to build an owners name to return its result.

The function MyName will return the name assigned to the owner of the rule.