CoordinateSystem (Csys) class

The CoordinateSystem class gives you access to define coordinate cards in PRIMER. 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:

Class functions

Member functions

CoordinateSystem constants

Name Description
CoordinateSystem.NODES Csys is *DEFINE_COORDINATE_NODES.
CoordinateSystem.SYSTEM Csys is *DEFINE_COORDINATE_SYSTEM.
CoordinateSystem.VECTOR Csys is *DEFINE_COORDINATE_VECTOR.

CoordinateSystem properties

Name Type Description
cid integer CoordinateSystem number. Also see the label number.
cidl integer Optional local coordinate system to define the points in
dir int Axis defined by N1N2
exists (read only) logical true if coordinate system exists, false if referred to but not defined.
flag logical Flag for updating local system each timestep
heading string CoordinateSystem heading
include integer The Include file number that the coordinate system is in.
label integer CoordinateSystem number. Also see the cid property which is an alternative name for this.
lx real X-coordinate of point on local X-axis
ly real Y-coordinate of point on local X-axis
lz real Z-coordinate of point on local X-axis
model (read only) integer The Model number that the coordinate system is in.
n1 int Node located at local origin
n2 int Node located along local (dir) axis
n3 int Node located in local plane determined by (dir)
nid integer Optional node id for rotation
option constant CoordinateSystem type (Can be CoordinateSystem.NODES, CoordinateSystem.SYSTEM or CoordinateSystem.VECTOR).
ox real X-coordinate of origin
oy real Y-coordinate of origin
oz real Z-coordinate of origin
px real X-coordinate of point in local X-Y plane
py real Y-coordinate of point in local X-Y plane
pz real Z-coordinate of point in local X-Y plane
vx real X-coordinate of local X-Y vector
vy real Y-coordinate of local X-Y vector
vz real Z-coordinate of local X-Y vector
xx real X-coordinate on local X-axis
xy real Y-coordinate on local X-axis
xz real Z-coordinate on local X-axis

Detailed Description

The CoordinateSystem class allows you to create, modify, edit and manipulate csys cards. See the documentation below for more details.

For convenience "Csys" can also be used as the class name instead of "CoordinateSystem".

Constructor

new CoordinateSystem(Model[Model], details[object])

Description

Create a new CoordinateSystem object for *DEFINE_COORDINATE_NODES.

Arguments

  • Model (Model)

    Model that csys will be created in

  • details (object)

    Details for creating the CoordinateSystem

    Object has the following properties:

    Name Type Description
    cid integer Label of CoordinateSystem
    cl (optional) array Array of coordinates of point on local X-axis [lx, ly, lz] (for option CoordinateSystem.SYSTEM)
    co (optional) array Array of coordinates of origin [ox, oy, oz] (for option CoordinateSystem.SYSTEM)
    cp (optional) array Array of coordinates of point in local X-Y plane [px, py, pz] (for option CoordinateSystem.SYSTEM)
    cv (optional) array Array of coordinates of local X-Y vector [vx, vy, vz] (for option CoordinateSystem.VECTOR)
    cx (optional) array Array of coordinates on local X-axis [xx, xy, xz] (for option CoordinateSystem.VECTOR)
    dir (optional) integer Axis defined by N1N2 (for option CoordinateSystem.NODES)
    flag (optional) boolean Flag for local system update for each time step (for option CoordinateSystem.NODES)
    heading (optional) string Title for the coordinate system
    nid (optional) integer Optional Node ID for rotation (for option CoordinateSystem.VECTOR)
    nodes (optional) array Array of Node IDs [n1, n2, n3] for the coordinate system (for option CoordinateSystem.NODES)
    option constant CoordinateSystem type (can be CoordinateSystem.NODES, CoordinateSystem.SYSTEM or CoordinateSystem.VECTOR)

    Returns

    CoordinateSystem object

    Return type

    CoordinateSystem

    Example

    To create a new Csys of type Nodes in model m with label 200 and title "Test csys 1" defined by nodes 1, 2, 3 with where N1N2 defines local Y-axis; local system update flag is off

    var c = new CoordinateSystem(m, {option: CoordinateSystem.NODES, cid: 200, nodes: [1, 2, 3], flag: 0, dir: 2, heading: "Test csys nodes"});

    To create a new Csys of type System in model m with label 300 and title "Test csys 2" with origin at (10, 10, 0), point on local X-axis at (20, 20, 0) and point in X-Y plane at (10, 20, 0)

    var c = new CoordinateSystem(m, {option: CoordinateSystem.SYSTEM, cid: 300, co: [10, 10, 0], cl: [20, 20, 0], cp: [10, 20, 0], heading: "Test csys system"});

    To create a new Csys of type Vector in model m with label 400 with point on local X-axis at (50, 50, 0) and local XY vector being (-10, -20, 0) that can rotate with node 10003

    var c = new CoordinateSystem(m, {option: CoordinateSystem.VECTOR, cid: 400, cx: [50, 50, 0], cv: [10, -20, 0], nid: 10003, heading: "Test csys vector"});

    new CoordinateSystem(Model[Model], option[constant], cid[integer], n1[integer], n2[integer], n3[integer], flag[boolean], dir[integer], heading (optional)[string])   [deprecated]

    This function is deprecated in version 21.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.

    Description

    Create a new CoordinateSystem object for *DEFINE_COORDINATE_NODES.

    Arguments

  • Model (Model)

    Model that csys will be created in

  • option (constant)

    Must be CoordinateSystem.NODES

  • cid (integer)

    CoordinateSystem number

  • n1 (integer)

    Node located at origin

  • n2 (integer)

    Node located along (DIR) axis

  • n3 (integer)

    Node located in plane defined by (DIR)

  • flag (boolean)

    Flag for local system update each time step

  • dir (integer)

    Axis defined by N1N2

  • heading (optional) (string)

    Title for the csys

    Returns

    CoordinateSystem object

    Return type

    CoordinateSystem

    Example

    To create a new Csys of type Nodes in model m with label 200 and title "Test csys 1" defined by nodes 1, 2, 3 with where N1N2 defines local Y-axis; local system update flag is off

    var c = new CoordinateSystem(m, CoordinateSystem.NODES, 200, 1, 2, 3, 0, 2, "Test csys");

    new CoordinateSystem(Model[Model], option[constant], cid[integer], ox[real], oy[real], oz[real], lx[real], ly[real], lz[real], px[real], py[real], pz[real], heading (optional)[string])   [deprecated]

    This function is deprecated in version 21.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.

    Description

    Create a new CoordinateSystem object for *DEFINE_COORDINATE_SYSTEM.

    Arguments

  • Model (Model)

    Model that csys will be created in

  • option (constant)

    Must be CoordinateSystem.SYSTEM

  • cid (integer)

    CoordinateSystem number

  • ox (real)

    X-coordinate of origin

  • oy (real)

    Y-coordinate of origin

  • oz (real)

    Z-coordinate of origin

  • lx (real)

    X-coordinate of point on local X-axis

  • ly (real)

    Y-coordinate of point on local X-axis

  • lz (real)

    Z-coordinate of point on local X-axis

  • px (real)

    X-coordinate of point in local X-Y plane

  • py (real)

    Y-coordinate of point in local X-Y plane

  • pz (real)

    Z-coordinate of point in local X-Y plane

  • heading (optional) (string)

    Title for the csys

    Returns

    No return value

    Example

    To create a new Csys of type System in model m with label 300 and title "Test csys 2" with origin at (10, 10, 0), point on local X-axis at (20, 20, 0) and point on X-y at (10, 20, 0)

    var c = new CoordinateSystem(m, CoordinateSystem.SYSTEM, 300, 10, 10, 0, 20, 20, 0, 10, 20, 0, "Test csys");

    new CoordinateSystem(Model[Model], option[constant], cid[integer], xx[real], xy[real], xz[real], vx[real], vy[real], vz[real], nid (optional)[integer], heading (optional)[string])   [deprecated]

    This function is deprecated in version 21.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.

    Description

    Create a new CoordinateSystem object for *DEFINE_COORDINATE_VECTOR.

    Arguments

  • Model (Model)

    Model that csys will be created in

  • option (constant)

    Must be CoordinateSystem.VECTOR

  • cid (integer)

    CoordinateSystem number

  • xx (real)

    X-coordinate on local X-axis

  • xy (real)

    Y-coordinate on local X-axis

  • xz (real)

    Z-coordinate on local X-axis

  • vx (real)

    X-coordinate of local X-Y vector

  • vy (real)

    Y-coordinate of local X-Y vector

  • vz (real)

    Z-coordinate of local X-Z vector

  • nid (optional) (integer)

    Optional node id for rotation

  • heading (optional) (string)

    Title for the csys

    Returns

    No return value

    Example

    To create a new Csys of type Vector in model m with label 400 with point on local X-axis at (50, 50, 0) and local XY being (-10, -20, 0) that can rotate with node 10003

    var c = new CoordinateSystem(m, CoordinateSystem.VECTOR, 400, 50, 50, 0, 10, -20 , 0, 10003);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a coordinate system.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the coordinate system

    Returns

    No return value

    Example

    To associate comment c to the coordinate system c:

    c.AssociateComment(c);


    Blank()

    Description

    Blanks the coordinate system

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank coordinate system c:

    c.Blank();


    BlankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be blanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To blank all of the coordinate systems in model m:

    CoordinateSystem.BlankAll(m);


    BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the flagged coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all the flagged coordinate systems will be blanked in

  • flag (Flag)

    Flag set on the coordinate systems that you want to blank

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To blank all of the coordinate systems in model m flagged with f:

    CoordinateSystem.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the coordinate system is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if coordinate system c is blanked:

    if (c.Blanked() ) do_something...


    Browse(modal (optional)[boolean])

    Description

    Starts an edit panel in Browse mode.

    Arguments

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    no return value

    Example

    To Browse coordinate system c:

    c.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the coordinate system.

    Arguments

  • flag (Flag)

    Flag to clear on the coordinate system

    Returns

    No return value

    Example

    To clear flag f for coordinate system c:

    c.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the coordinate system. The target include of the copied coordinate system can be set using Options.copy_target_include.

    Arguments

  • range (optional) (boolean)

    If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer().

    Returns

    CoordinateSystem object

    Return type

    CoordinateSystem

    Example

    To copy coordinate system c into coordinate system z:

    var z = c.Copy();


    Create(Model[Model], modal (optional)[boolean]) [static]

    Description

    Starts an interactive editing panel to create a coordinate system

    Arguments

  • Model (Model)

    Model that the coordinate system will be created in.

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    CoordinateSystem object (or null if not made).

    Return type

    CoordinateSystem

    Example

    To start creating a coordinate system in model m:

    var c = CoordinateSystem.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a coordinate system.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the coordinate system

    Returns

    No return value

    Example

    To detach comment c from the coordinate system c:

    c.DetachComment(c);


    Edit(modal (optional)[boolean])

    Description

    Starts an interactive editing panel.

    Arguments

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    no return value

    Example

    To Edit coordinate system c:

    c.Edit();


    Error(message[string], details (optional)[string])

    Description

    Adds an error for coordinate system. For more details on checking see the Check class.

    Arguments

  • message (string)

    The error message to give

  • details (optional) (string)

    An optional detailed error message

    Returns

    No return value

    Example

    To add an error message "My custom error" for coordinate system c:

    c.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first coordinate system in the model.

    Arguments

  • Model (Model)

    Model to get first coordinate system in

    Returns

    CoordinateSystem object (or null if there are no coordinate systems in the model).

    Return type

    CoordinateSystem

    Example

    To get the first coordinate system in model m:

    var c = CoordinateSystem.First(m);


    FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the first free coordinate system label in the model. Also see CoordinateSystem.LastFreeLabel(), CoordinateSystem.NextFreeLabel() and Model.FirstFreeItemLabel().

    Arguments

  • Model (Model)

    Model to get first free coordinate system label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels).

    Returns

    CoordinateSystem label.

    Return type

    Number

    Example

    To get the first free coordinate system label in model m:

    var label = CoordinateSystem.FirstFreeLabel(m);


    FlagAll(Model[Model], flag[Flag]) [static]

    Description

    Flags all of the coordinate systems in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be flagged in

  • flag (Flag)

    Flag to set on the coordinate systems

    Returns

    No return value

    Example

    To flag all of the coordinate systems with flag f in model m:

    CoordinateSystem.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the coordinate system is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the coordinate system

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if coordinate system c has flag f set on it:

    if (c.Flagged(f) ) do_something...


    ForEach(Model[Model], func[function], extra (optional)[any]) [static]

    Description

    Calls a function for each coordinate system in the model.
    Note that ForEach has been designed to make looping over coordinate systems as fast as possible and so has some limitations.
    Firstly, a single temporary CoordinateSystem object is created and on each function call it is updated with the current coordinate system data. This means that you should not try to store the CoordinateSystem object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new coordinate systems inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all coordinate systems are in

  • func (function)

    Function to call for each coordinate system

  • extra (optional) (any)

    An optional extra object/array/string etc that will appended to arguments when calling the function

    Returns

    No return value

    Example

    To call function test for all of the coordinate systems in model m:

    CoordinateSystem.ForEach(m, test);
    function test(c)
    {
    // c is CoordinateSystem object
    }

    To call function test for all of the coordinate systems in model m with optional object:

    var data = { x:0, y:0 };
    CoordinateSystem.ForEach(m, test, data);
    function test(c, extra)
    {
    // c is CoordinateSystem object
    // extra is data
    }


    GetAll(Model[Model], property (optional)[string]) [static]

    Description

    Returns an array of CoordinateSystem objects or properties for all of the coordinate systems in a model in PRIMER. If the optional property argument is not given then an array of CoordinateSystem objects is returned. If the property argument is given, that property value for each coordinate system is returned in the array instead of a CoordinateSystem object

    Arguments

  • Model (Model)

    Model to get coordinate systems from

  • property (optional) (string)

    Name for property to get for all coordinate systems in the model

    Returns

    Array of CoordinateSystem objects or properties

    Return type

    Array

    Example

    To make an array of CoordinateSystem objects for all of the coordinate systems in model m:

    var a = CoordinateSystem.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for each coordinate system in model m:

    var a = CoordinateSystem.GetAll(m, 'foo');


    GetComments()

    Description

    Extracts the comments associated to a coordinate system.

    Arguments

    No arguments

    Returns

    Array of Comment objects (or null if there are no comments associated to the node).

    Return type

    Array

    Example

    To get the array of comments associated to the coordinate system c:

    var comm_array = c.GetComments();


    GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]

    Description

    Returns an array of CoordinateSystem objects for all of the flagged coordinate systems in a model in PRIMER If the optional property argument is not given then an array of CoordinateSystem objects is returned. If the property argument is given, then that property value for each coordinate system is returned in the array instead of a CoordinateSystem object

    Arguments

  • Model (Model)

    Model to get coordinate systems from

  • flag (Flag)

    Flag set on the coordinate systems that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged coordinate systems in the model

    Returns

    Array of CoordinateSystem objects or properties

    Return type

    Array

    Example

    To make an array of CoordinateSystem objects for all of the coordinate systems in model m flagged with f:

    var c = CoordinateSystem.GetFlagged(m, f);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for all of the coordinate systems in model m flagged with f:

    var a = CoordinateSystem.GetFlagged(m, f, 'foo');


    GetFromID(Model[Model], number[integer]) [static]

    Description

    Returns the CoordinateSystem object for a coordinate system ID.

    Arguments

  • Model (Model)

    Model to find the coordinate system in

  • number (integer)

    number of the coordinate system you want the CoordinateSystem object for

    Returns

    CoordinateSystem object (or null if coordinate system does not exist).

    Return type

    CoordinateSystem

    Example

    To get the CoordinateSystem object for coordinate system 100 in model m

    var c = CoordinateSystem.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

    Checks if a CoordinateSystem property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the CoordinateSystem.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    coordinate system property to get parameter for

    Returns

    Parameter object if property is a parameter, null if not.

    Return type

    Parameter

    Example

    To check if CoordinateSystem property c.example is a parameter:

    Options.property_parameter_names = true;
    if (c.GetParameter(c.example) ) do_something...
    Options.property_parameter_names = false;

    To check if CoordinateSystem property c.example is a parameter by using the GetParameter method:

    if (c.ViewParameters().GetParameter(c.example) ) do_something...


    Keyword()

    Description

    Returns the keyword for this csys (*DEFINE_COORDINATE). Note that a carriage return is not added. See also CoordinateSystem.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for csys m:

    var key = m.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the csys. Note that a carriage return is not added. See also CoordinateSystem.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for csys c:

    var cards = v.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last coordinate system in the model.

    Arguments

  • Model (Model)

    Model to get last coordinate system in

    Returns

    CoordinateSystem object (or null if there are no coordinate systems in the model).

    Return type

    CoordinateSystem

    Example

    To get the last coordinate system in model m:

    var c = CoordinateSystem.Last(m);


    LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the last free coordinate system label in the model. Also see CoordinateSystem.FirstFreeLabel(), CoordinateSystem.NextFreeLabel() and see Model.LastFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get last free coordinate system label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.

    Returns

    CoordinateSystem label.

    Return type

    Number

    Example

    To get the last free coordinate system label in model m:

    var label = CoordinateSystem.LastFreeLabel(m);


    Next()

    Description

    Returns the next coordinate system in the model.

    Arguments

    No arguments

    Returns

    CoordinateSystem object (or null if there are no more coordinate systems in the model).

    Return type

    CoordinateSystem

    Example

    To get the coordinate system in model m after coordinate system c:

    var c = c.Next();


    NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the next free (highest+1) coordinate system label in the model. Also see CoordinateSystem.FirstFreeLabel(), CoordinateSystem.LastFreeLabel() and Model.NextFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get next free coordinate system label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels).

    Returns

    CoordinateSystem label.

    Return type

    Number

    Example

    To get the next free coordinate system label in model m:

    var label = CoordinateSystem.NextFreeLabel(m);


    Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]

    Description

    Allows the user to pick a coordinate system.

    Arguments

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only coordinate systems from that model can be picked. If the argument is a Flag then only coordinate systems that are flagged with limit can be selected. If omitted, or null, any coordinate systems from any model can be selected. from any model.

  • modal (optional) (boolean)

    If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal.

  • button text (optional) (string)

    By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.

    Returns

    CoordinateSystem object (or null if not picked)

    Return type

    CoordinateSystem

    Example

    To pick a coordinate system from model m giving the prompt 'Pick coordinate system from screen':

    var c = CoordinateSystem.Pick('Pick coordinate system from screen', m);


    Previous()

    Description

    Returns the previous coordinate system in the model.

    Arguments

    No arguments

    Returns

    CoordinateSystem object (or null if there are no more coordinate systems in the model).

    Return type

    CoordinateSystem

    Example

    To get the coordinate system in model m before coordinate system c:

    var c = c.Previous();


    RenumberAll(Model[Model], start[integer]) [static]

    Description

    Renumbers all of the coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the coordinate systems in model m, from 1000000:

    CoordinateSystem.RenumberAll(m, 1000000);


    RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]

    Description

    Renumbers all of the flagged coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all the flagged coordinate systems will be renumbered in

  • flag (Flag)

    Flag set on the coordinate systems that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the coordinate systems in model m flagged with f, from 1000000:

    CoordinateSystem.RenumberFlagged(m, f, 1000000);


    Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]

    Description

    Allows the user to select coordinate systems using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting coordinate systems

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only coordinate systems from that model can be selected. If the argument is a Flag then only coordinate systems that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any coordinate systems can be selected. from any model.

  • modal (optional) (boolean)

    If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal.

    Returns

    Number of coordinate systems selected or null if menu cancelled

    Return type

    Number

    Example

    To select coordinate systems from model m, flagging those selected with flag f, giving the prompt 'Select coordinate systems':

    CoordinateSystem.Select(f, 'Select coordinate systems', m);

    To select coordinate systems, flagging those selected with flag f but limiting selection to coordinate systems flagged with flag l, giving the prompt 'Select coordinate systems':

    CoordinateSystem.Select(f, 'Select coordinate systems', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the coordinate system.

    Arguments

  • flag (Flag)

    Flag to set on the coordinate system

    Returns

    No return value

    Example

    To set flag f for coordinate system c:

    c.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

    Sketches the coordinate system. The coordinate system will be sketched until you either call CoordinateSystem.Unsketch(), CoordinateSystem.UnsketchAll(), Model.UnsketchAll(), or delete the model

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not after the coordinate system is sketched. If omitted redraw is true. If you want to sketch several coordinate systems and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To sketch coordinate system c:

    c.Sketch();


    SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Sketches all of the flagged coordinate systems in the model. The coordinate systems will be sketched until you either call CoordinateSystem.Unsketch(), CoordinateSystem.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

    Arguments

  • Model (Model)

    Model that all the flagged coordinate systems will be sketched in

  • flag (Flag)

    Flag set on the coordinate systems that you want to sketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the coordinate systems are sketched. If omitted redraw is true. If you want to sketch flagged coordinate systems several times and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To sketch all coordinate systems flagged with flag in model m:

    CoordinateSystem.SketchFlagged(m, flag);


    Total(Model[Model], exists (optional)[boolean]) [static]

    Description

    Returns the total number of coordinate systems in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    true if only existing coordinate systems should be counted. If false or omitted referenced but undefined coordinate systems will also be included in the total.

    Returns

    number of coordinate systems

    Return type

    Number

    Example

    To get the total number of coordinate systems in model m:

    var total = CoordinateSystem.Total(m);


    Unblank()

    Description

    Unblanks the coordinate system

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank coordinate system c:

    c.Unblank();


    UnblankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be unblanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To unblank all of the coordinate systems in model m:

    CoordinateSystem.UnblankAll(m);


    UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the flagged coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that the flagged coordinate systems will be unblanked in

  • flag (Flag)

    Flag set on the coordinate systems that you want to unblank

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To unblank all of the coordinate systems in model m flagged with f:

    CoordinateSystem.UnblankFlagged(m, f);


    UnflagAll(Model[Model], flag[Flag]) [static]

    Description

    Unsets a defined flag on all of the coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all coordinate systems will be unset in

  • flag (Flag)

    Flag to unset on the coordinate systems

    Returns

    No return value

    Example

    To unset the flag f on all the coordinate systems in model m:

    CoordinateSystem.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the coordinate system.

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not after the coordinate system is unsketched. If omitted redraw is true. If you want to unsketch several coordinate systems and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch coordinate system c:

    c.Unsketch();


    UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unsketches all coordinate systems.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be unblanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not after the coordinate systems are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch all coordinate systems in model m:

    CoordinateSystem.UnsketchAll(m);


    UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unsketches all flagged coordinate systems in the model.

    Arguments

  • Model (Model)

    Model that all coordinate systems will be unsketched in

  • flag (Flag)

    Flag set on the coordinate systems that you want to unsketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the coordinate systems are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch all coordinate systems flagged with flag in model m:

    CoordinateSystem.UnsketchAll(m, flag);


    ViewParameters()

    Description

    Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with 'method chaining' (see the example below) to make sure a property argument is correct.

    Arguments

    No arguments

    Returns

    CoordinateSystem object.

    Return type

    CoordinateSystem

    Example

    To check if CoordinateSystem property c.example is a parameter by using the CoordinateSystem.GetParameter() method:

    if (c.ViewParameters().GetParameter(c.example) ) do_something...


    Warning(message[string], details (optional)[string])

    Description

    Adds a warning for coordinate system. For more details on checking see the Check class.

    Arguments

  • message (string)

    The warning message to give

  • details (optional) (string)

    An optional detailed warning message

    Returns

    No return value

    Example

    To add a warning message "My custom warning" for coordinate system c:

    c.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this coordinate system.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for coordinate system c:

    var xrefs = c.Xrefs();


    toString()

    Description

    Creates a string containing the csys data in keyword format. Note that this contains the keyword header and the keyword cards. See also CoordinateSystem.Keyword() and CoordinateSystem.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for csys c in keyword format

    var s = v.toString();