Home Search

DriveWorks Pro 21
MyNumber

Send Feedback

MyNumber

Gets the specified number from within the owners name.

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.

Examples used in a Calculation Table

The Owners Name of a Calculation Table cell is constructed using Absolute Cell Referencing as follows:

DWCalc[CalculationTableName].[ColumnName][RowNumber]

The table below shows the result of the MyNumber function when applied to a cell of a Calculation Table.

Owners NameRuleResult
DWCalcCost2Data.Price4

(This owners name is constructed from the Calculation Table name Cost2Data, a column named Price and row number 4.)

MyNumber(-1)4
DWCalcCost2Data.Price4

(This owners name is constructed from the Calculation Table name Cost2Data, a column named Price and row number 4.)

MyNumber(1)2

A typical use of MyNumber would be to pull corresponding values from another table into the Calculation Table, for example:

Simple Table (DWLookupParts)Calculation Table
PartNamePartNumberPartNumber (Column Rule)Result
Frame2019-032TableGetValue(DwLookupParts,2,MyNumber(-1))2019-032
Base1238-19TableGetValue(DwLookupParts,2,MyNumber(-1))1238-19
Cover4627-12TableGetValue(DwLookupParts,2,MyNumber(-1))4627-12

Examples used in a DriveWorks 3D Document

See DriveWorks 3D File.

Owners NameRuleResult
Root\RootNode3\ChildNode-9MyNumber(1)3
Root\RootNode3\ChildNode-9MyNumber(-1)9

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.

See Calculation Table - Absolute Cell Referencing to reference the name of a Calculation Table cell.