maptek.vulcan.arrow

Interface for Vulcan design arrows.


set_auto_scale(arrow self, bool autoscale=True)

Sets the arrow auto scale setting.

# Filename: arrow_auto_scale.py
# Purpose: Sets the arrow auto scale setting.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_auto_scale(autoscale=True)  # set autoscale to true
    layer.set_object(0, arrow_object)  # update arrow
    dgd.save_layer(layer)

is_auto_scale(self) -> bool

Check the arrow auto scale setting.

# Filename: arrow_auto_scale.py
# Purpose: Use to check if arrow is auto-scaled
# Returns: bool, True if arrow is auto-scaled, False if not auto-scaled

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    print(arrow_object.is_auto_scale())  # check if arrow is auto-scaled

get_arrow_type(arrow self) → std::string

Gets the arrow type(2D/3D).

# Filename: arrow_set_arrow_type.py
# Purpose: Gets the arrow type (2D/3D).
# Returns: String

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_type = arrow_object.get_arrow_type()  # get the arrow type
        print(f"{arrow_type}")

set_arrow_type(arrow self, std::string const & type)

Sets the arrow type.

"""
Filename: arrow_set_arrow_type.py
Purpose: Set the arrow type (2D or 3D).
         This script also demonstrates the usage of the following functions:
            set_relative_head_length(float)  # set head length
            set_relative_head_width(float)  # set head width
            set_num_facets(int)  # set number of head facets
            set_filled(filled=bool)
Returns: Null
"""

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_arrow_type('3D')  # set arrow as 3D
    arrow_object.set_relative_head_length(10.0)  # set head length to 10%
    arrow_object.set_relative_head_width(5.0)  # set head width to 5%
    arrow_object.set_num_facets(4)  # set head to have 4 facets
    arrow_object.set_filled(filled=True)
    layer.set_object(0, arrow_object)  # updated arrow object
    dgd.save_layer(layer)

get_end(arrow self) → point

Gets the arrow end point.

# Filename: arrow_get_end.py
# Purpose: Get the end point of an arrow.
# Returns: point

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, "r") as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_start = arrow_object.get_end()  # get the starting point
    print(arrow_start)

set_end(arrow self, point point)

Sets the arrow end point.

# Filename: arrow_set_end.py
# Purpose: Set the starting point of an arrow.
# Returns: null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

end_pt = vulcan.point(83000.00, 2000.00, 0.00)  # create a point

with vulcan.dgd(dgd_file, "w") as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_end(end_pt)  # set the new starting point
    layer.set_object(0, arrow_object)  # replace old arrow with updated arrow
    dgd.save_layer(layer)

is_filled(arrow self) → bool

Returns the arrow fill setting.

# Filename: arrow_is_filled.py
# Purpose: Check the arrow fill setting.
# Returns: bool

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    print(arrow_object.is_filled())  # Check the arrow fill setting.

set_filled(arrow self, bool filled=True)

Sets the arrow fill setting.

# Filename: arrow_set_filled.py
# Purpose: Sets the arrow fill setting.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_filled(filled=True)  # sets arrow as filled
    layer.set_object(0, arrow_object)  # update arrow
    dgd.save_layer(layer)

get_head_length(arrow self) → double

Gets the arrow head length.

# Filename: arrow_get_head_length.py
# Purpose: Gets the arrow head length.
# Returns: float

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object

        # get the arrow head length
        arrow_head_length = arrow_object.get_head_length()
        print(f"arrow {i}: {arrow_head_length}")

set_head_length(arrow self, double percentage)

Sets the arrow head length.

# Filename: arrow_set_head_length.py
# Purpose: Sets the arrow head length.
# Returns: null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object

        # Percentage of the arrow's length to use as the head.
        arrow_object.set_head_length(5.0)
        layer.set_object(i, arrow_object)  # updated arrow
        dgd.save_layer(layer)

get_head_width(arrow self) → double

Gets the arrow head width.

# Filename: arrow_get_head_width.py
# Purpose: Gets the arrow head width.
# Returns: floats

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_head_length = arrow_object.get_head_width()  # Get head width
        print(f"arrow {i}: {arrow_head_length}")

set_head_width(arrow self, double percentage)

Sets the arrow head width.

# Filename: arrow_set_head_width.py
# Purpose: Sets the arrow head width.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object

        # Percentage of the arrow's length to use as the head.
        arrow_object.set_head_width(5.0)
        layer.set_object(i, arrow_object)  # updated arrow
        dgd.save_layer(layer)

get_normal(arrow self) → point

Gets the arrow normal.

# Filename: arrow_get_normal.py
# Purpose: Gets the arrow normal. Gets the up direction in the form of a unit vector.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(4)  # get the arrow object
    arrow_normal = arrow_object.get_normal()  # get the normal
    print(f"{arrow_normal}")

set_normal(arrow self, point point)

Sets the arrow normal.

# Filename: arrow_set_normal.py
# Purpose: Sets the arrow normal. Sets the up direction in the form of a unit vector.
# Returns: Null

from maptek import vulcan

new_normal = vulcan.point(0.0, -0.0, 1.0, 0.0, 259, '')
dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_normal(new_normal)
    layer.set_object(0, arrow_object)  # updated arrow
    dgd.save_layer(layer)

get_num_facets(arrow self) → int

Gets the number of facets.

# Filename: arrow_get_num_facets.py
# Purpose: Gets the number of facets.
# Returns: int

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_num_facets = arrow_object.get_num_facets()  # get the number of facets
    print(f"Number of facets: {arrow_num_facets}")
set_num_facets(arrow self, int facets)

Sets the number of facets.

# Filename: arrow_set_num_facets.py
# Purpose: Sets the number of facets.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrw_object = layer.get_object(0)  # get the arrow object
    arrw_object.set_num_facets(8)  # set the number of facets
    layer.set_object(0, arrw_object)  # replace the old arrow with the updated arrow
    dgd.save_layer(layer)

get_relative_head_length(arrow self) → double

Gets the relative arrow head length.

# Filename: arrow_get_relative_head_length.py
# Purpose: Gets the relative arrow head length.
# Returns: float

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object

        # get the relative arrow head length
        arrow_head_length = arrow_object.get_relative_head_length()
        print(f"arrow {i}: {arrow_head_length}")

set_relative_head_length(arrow self, double percentage)

Sets the relative arrow head length.

"""
Filename: arrow_set_arrow_type.py
Purpose: Set the arrow type (2D or 3D).
         This script also demonstrates the usage of the following functions:
            set_relative_head_length(float)  # set head length
            set_relative_head_width(float)  # set head width
            set_num_facets(int)  # set number of head facets
            set_filled(filled=bool)
Returns: Null
"""

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_arrow_type('3D')  # set arrow as 3D
    arrow_object.set_relative_head_length(10.0)  # set head length to 10%
    arrow_object.set_relative_head_width(5.0)  # set head width to 5%
    arrow_object.set_num_facets(4)  # set head to have 4 facets
    arrow_object.set_filled(filled=True)
    layer.set_object(0, arrow_object)  # updated arrow object
    dgd.save_layer(layer)

get_relative_head_width(arrow self) → double

Gets the relative arrow head width.

# Filename: arrow_get_relative_head_width.py
# Purpose: Gets the relative arrow head width.
# Returns: float

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object

        # get the relative arrow head width
        arrow_head_length = arrow_object.get_relative_head_width()
        print(f"arrow {i}: {arrow_head_length}")

set_relative_head_width(arrow self, double percentage)

Sets the relative arrow head width.

"""
Filename: arrow_set_arrow_type.py
Purpose: Set the arrow type (2D or 3D).
         This script also demonstrates the usage of the following functions:
            set_relative_head_length(float)  # set head length
            set_relative_head_width(float)  # set head width
            set_num_facets(int)  # set number of head facets
            set_filled(filled=bool)
Returns: Null
"""

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_arrow_type('3D')  # set arrow as 3D
    arrow_object.set_relative_head_length(10.0)  # set head length to 10%
    arrow_object.set_relative_head_width(5.0)  # set head width to 5%
    arrow_object.set_num_facets(4)  # set head to have 4 facets
    arrow_object.set_filled(filled=True)
    layer.set_object(0, arrow_object)  # updated arrow object
    dgd.save_layer(layer)

get_scale(arrow self) → std::string

Gets the arrow scale.

# Filename: arrow_get_scale.py
# Purpose: Gets the arrow scale.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_scale = arrow_object.get_scale()  # get the scale
        print(f"{arrow_scale}")

set_scale(arrow self, std::string const & scale)

Sets the arrow scale.

# Filename: arrow_set_scale.py
# Purpose: Sets the arrow scale.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_scale = arrow_object.set_scale('1:12500')  # get the scale
        layer.set_object(i, arrow_object)  # updated arrow object
        dgd.save_layer(layer)

get_scaled_head_length(arrow self) → double

Gets the scaled head length of the arrow.

# Filename: arrow_get_scaled_head_length.py
# Purpose: Gets the scaled head width of the arrow.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_scale = arrow_object.get_scaled_head_length()  # get the scale
        print(f"{arrow_scale}")

get_scaled_head_width(arrow self) → double

Gets the scaled head width of the arrow.

# Filename: arrow_get_scaled_head_width.py
# Purpose: Gets the scaled head width of the arrow.
# Returns: Null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, 'r') as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    for i in range(len(layer)):
        arrow_object = layer.get_object(i)  # get the arrow object
        arrow_scale = arrow_object.get_scaled_head_width()  # get the scale
        print(f"{arrow_scale}")

get_start(arrow self) → point

Gets the arrow starting point.

# Filename: arrow_get_start.py
# Purpose: Get the starting point of an arrow.
# Returns: point

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

with vulcan.dgd(dgd_file, "r") as dgd:  # open up the database in read mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_start = arrow_object.get_start()  # get the starting point
    print(arrow_start)

set_start(arrow self, point point)

Sets the arrow starting point.

# Filename: arrow_set_start.py
# Purpose: Set the starting point of an arrow.
# Returns: null

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database we want to access
layer_name = "ARROWS"  # name of layer we want to use

start_pt = vulcan.point(80000.00, -500.00, 0.00)  # create a point
end_pt = vulcan.point(82000.00, 2000.00, 0.00)  # create a point

with vulcan.dgd(dgd_file, 'w') as dgd:  # open up the database in write mode
    assert dgd.is_layer(layer_name), 'error: layer does not exist'
    layer = dgd.get_layer(layer_name)  # get layer

    arrow_object = layer.get_object(0)  # get the arrow object
    arrow_object.set_start(start_pt)  # set the new starting point
    layer.set_object(0, arrow_object)  # replace old arrow with updated arrow
    dgd.save_layer(layer)