Gets the specified number from within the owners name.
The maximum integer that can be extracted from an owner is 253 (9007199254740992).
MyNumber([Index])
Where:
Index (optional) is the index specifying which number to return.
The table below shows the result of the MyNumber function when applied to a Variable that includes a number in its name.
Owners Name | Rule | Result |
---|---|---|
DWVariableMyVar123Test45Test6 | MyNumber(1) | 123 |
DWVariableMyVar123Test45Test6 | MyNumber(2) | 45 |
DWVariableMyVar123Test45Test6 | MyNumber(3) | 6 |
DWVariableMyVar123Test45Test6 | MyNumber(-3) | 123 |
DWVariableMyVar123Test45Test6 | MyNumber(-2) | 45 |
DWVariableMyVar123Test45Test6 | MyNumber(-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.
The table below shows the result of the MyNumber function when applied to various Model Rules.
Owners Name | Rule | Result |
---|---|---|
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. |
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 Name | Rule | Result |
---|---|---|
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 | |||
---|---|---|---|---|
PartName | PartNumber | PartNumber (Column Rule) | Result | |
Frame | 2019-032 | TableGetValue(DwLookupParts,2,MyNumber(-1)) | 2019-032 | |
Base | 1238-19 | TableGetValue(DwLookupParts,2,MyNumber(-1)) | 1238-19 | |
Cover | 4627-12 | TableGetValue(DwLookupParts,2,MyNumber(-1)) | 4627-12 |
See DriveWorks 3D File.
Owners Name | Rule | Result |
---|---|---|
Root\RootNode3\ChildNode-9 | MyNumber(1) | 3 |
Root\RootNode3\ChildNode-9 | MyNumber(-1) | 9 |
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.