The Xrefs class gives you access to cross references. More...
The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
Detailed DescriptionThe Xrefs class allows you to look at what things use an item. e.g. a node may be used on several shells. See the documentation below for more details. |
Details of functionsGetID(type[string], pos[integer]) [deprecated]This function is deprecated in version 10.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionUse Xrefs.GetItemID() instead. |
Use Xrefs.GetItemID() instead.
Use Xrefs.GetItemID() instead.
ReturnsNo return value |
GetItemID(type[string], pos[integer])DescriptionReturns the ID of the item in the reference list. |
The type of the item in the reference list (for a list of types see Appendix I of the PRIMER manual).
The position in the list for this item. Note that positions start at 0, not 1
ReturnsID of item Return typeNumber |
GetItemType(type[string], pos[integer])DescriptionReturns the type of the item in the reference list. This function is only required when trying to look at cross references to *DEFINE_CURVE items. These items are used in a slightly different way in PRIMER (each time a curve is used a 'LOADCURVE REFERENCE' structure is created to store things like the units and descriptions of each axis for the curve). If you try to get the cross references for a curve all the references will be of type 'LOADCURVE REFERENCE' and numtypes will be 1. GetItemID() will correctly return the ID of the item from the 'LOADCURVE REFERENCE' structure but to get the type of the item this function is required. |
The type of the item in the reference list (for a list of types see Appendix I of the PRIMER manual).
The position in the list for this item. Note that positions start at 0, not 1
Returnstype of item (String). For every item apart from *DEFINE_CURVE items this will be the same as the type argument. Return typeString |
GetTotal(type[string])DescriptionReturns the total number of references of a type. |
The type of the item in the reference list (for a list of types see Appendix I of the PRIMER manual).
ReturnsNumber of refs (integer) Return typeNumber |
ExampleTo find the total number of shell references that node n has: var xrefs = n.Xrefs();
var num = xrefs.GetTotal("SHELL");
|
GetType(n[integer])DescriptionReturns the type for an entry in the reference list. Note that for a curve all the references will be of type 'LOADCURVE REFERENCE' and numtypes will be 1. See GetItemType() for more details. |
The entry in the reference types that you want the type for. Note that entries start at 0, not 1
ReturnsThe type of the item (string) Return typeString |