Wiki

Clone wiki

VW DLibrary / 2016 / api / object

MODULE dlibrary.object

Used for all object related stuff, except for plug-in objects.

CLASSES

builtins.object
........IObjectHandle(builtins.object)
................IObjectAttributes(IObjectHandle, dlibrary.document.IAttributes)
........................AbstractObject(dlibrary.object_base.AbstractKeyedObject, IObjectAttributes, IObjectRecords, IObjectOrder)
................................DrawnObject(AbstractObject)
................................Group(AbstractObject)
................................Line(AbstractObject)
................................Locus(AbstractObject)
................................Polygon(AbstractObject)
................................Rectangle(AbstractObject)
................................Symbol(AbstractObject)
................................Text(AbstractObject)
................................Viewport(AbstractObject)
................IObjectOrder(IObjectHandle)
........IObjectRecords(builtins.object)
........SymbolScalingEnum(builtins.object)
........TextHorizontalAlignmentEnum(builtins.object)
........TextVerticalAlignmentEnum(builtins.object)
dlibrary.object_base.AbstractKeyedObject(builtins.object)
........AbstractObject(dlibrary.object_base.AbstractKeyedObject, IObjectAttributes, IObjectRecords, IObjectOrder)
................DrawnObject(AbstractObject)
................Group(AbstractObject)
................Line(AbstractObject)
................Locus(AbstractObject)
................Polygon(AbstractObject)
................Rectangle(AbstractObject)
................Symbol(AbstractObject)
................Text(AbstractObject)
................Viewport(AbstractObject)
........Attributes(dlibrary.object_base.AbstractKeyedObject)
........Record(dlibrary.object_base.AbstractKeyedObject)
........RecordField(dlibrary.object_base.AbstractKeyedObject)


class AbstractObject(dlibrary.object_base.AbstractKeyedObject, IObjectAttributes, IObjectRecords, IObjectOrder)

> dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class Attributes(dlibrary.object_base.AbstractKeyedObject)

We will use the object handle to get/set the attributes for it.

> dlibrary.object_base.AbstractKeyedObject > builtins.object

__init__(self, handle: vs.Handle)

by_clazz GET/SET ``

handle GET :rtype: vs.Handle

name GET :rtype: str


class DrawnObject(AbstractObject)

You can use this wrapper for objects that aren't yet in this library. As the object repository will not always know all possible object types, due to the fact that we are still working on DLibrary, and that Vectorworks can introduce new types, this class can be used for it's general properties.

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class Group(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

create(content_creator: <built-in function callable>)

:type content_creator: () -> None
:rtype: Group

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class IObjectAttributes(IObjectHandle, dlibrary.document.IAttributes)

Interface that handles object attributes.

> IObjectHandle > dlibrary.document.IAttributes > builtins.object

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine


class IObjectHandle(builtins.object)

Abstract interface to define the object handle field that all object interfaces need.


class IObjectOrder(IObjectHandle)

Interface that handles object stacking order.

> IObjectHandle > builtins.object

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)


class IObjectRecords(builtins.object)

OBSOLETE, use dlibrary.document.IRecords instead.

records GET :rtype: dict[str, Record]


class Line(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle: vs.Handle)

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

begin GET ``

clazz GET/SET ``

create(point1: tuple, point2: tuple)

:type point1: (float | str, float | str)
:type point2: (float | str, float | str)
:rtype: Line

end GET ``

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class Locus(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

create(origin: tuple)

:type origin: (float | str, float | str)
:rtype: Locus

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class Polygon(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle: vs.Handle)

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

create(vertices: tuple, closed: bool=True)

:type vertices: tuple[tuple[x: float|str, y: float|str]]

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)


class Record(dlibrary.object_base.AbstractKeyedObject)

OBSOLETE, use dlibrary.document.Record instead.

> dlibrary.object_base.AbstractKeyedObject > builtins.object

__init__(self, handle: vs.Handle, object_handle: vs.Handle=None)

Use the object_handle, as it will become mandatory in future versions!
Not using the object_handle will make working with the record instance very limited!

fields GET :rtype: OrderedDict[str, RecordField]

get_field(self, index: int) -> RecordField

Get the field based on it's index, 1-n based.

handle GET :rtype: vs.Handle

name GET :rtype: str

parametric GET :rtype: bool


class RecordField(dlibrary.object_base.AbstractKeyedObject)

OBSOLETE, use dlibrary.document.RecordField instead.

> dlibrary.object_base.AbstractKeyedObject > builtins.object

__init__(self, record_handle: vs.Handle, index: int, record_name: str=None, object_handle: vs.Handle=None, parametric: bool=False)

Use the record_name, object_handle and parametric, as they will become mandatory in future versions!
Not using them will render most things in this class useless!

handle GET :rtype: vs.Handle OBSOLETE!

name GET :rtype: str

type GET :rtype: DataFieldTypeEnum | PioFieldTypeEnum

value GET/SET :rtype: str | int | bool | float


class Rectangle(AbstractObject)

Class that represents a rectangle object.

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

center GET :rtype: (float, float)

clazz GET/SET ``

create(origin: tuple, direction: tuple, width, height)

:type origin: (float | str, float | str)
:type direction: (float | str, float | str)
:type width: float | str
:type height: float | str
:rtype: Rectangle

create_by_diagonal(top_left: tuple, bottom_right: tuple)

:type top_left: (float | str, float | str)
:type bottom_right: (float | str, float | str)
:rtype: Rectangle

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

height GET/SET :rtype: float

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)

width GET/SET :rtype: float


class Symbol(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

create(definition: dlibrary.document.SymbolDefinition, insertion_point: tuple, rotation: float)

:type insertion_point: (float | str, float | str)
:rtype: Symbol

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)

scale_x GET/SET :rtype: float

scale_y GET/SET :rtype: float

scale_z GET/SET :rtype: float

scaling GET/SET :rtype: SymbolScalingEnum


class SymbolScalingEnum(builtins.object)

Holds all possible scaling options for symbol instances.

  • ASYMMETRIC = 3
  • NONE = 1
  • SYMMETRIC = 2

class Text(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle_or_name)

:type handle_or_name: vs.Handle | str

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

create(text: str, origin: tuple, horizontal_alignment: int=None, vertical_alignment: int=None)

:type origin: (float | str, float | str)
:type horizontal_alignment: TextHorizontalAlignmentEnum
:type vertical_alignment: TextVerticalAlignmentEnum
:rtype: Text

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

horizontal_alignment GET/SET :rtype: TextHorizontalAlignmentEnum

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)

vertical_alignment GET/SET :rtype: TextVerticalAlignmentEnum


class TextHorizontalAlignmentEnum(builtins.object)

  • CENTER = 2
  • JUSTIFY = 4
  • LEFT = 1
  • RIGHT = 3

class TextVerticalAlignmentEnum(builtins.object)

  • BOTTOM = 5
  • BOTTOM_BASELINE = 4
  • CENTER = 3
  • TOP = 1
  • TOP_BASELINE = 2

class Viewport(AbstractObject)

> AbstractObject > dlibrary.object_base.AbstractKeyedObject > IObjectAttributes > IObjectRecords > IObjectOrder > IObjectHandle > dlibrary.document.IAttributes > builtins.object

__init__(self, handle: vs.Handle)

attributes GET ``

bb_bottom GET :rtype: float

bb_height GET :rtype: float

bb_left GET :rtype: float

bb_right GET :rtype: float

bb_top GET :rtype: float

bb_width GET :rtype: float

clazz GET/SET ``

fill GET/SET :rtype: PatternFillEnum | T <= AbstractVectorFill

handle GET :rtype: vs.Handle

layer GET ``

line GET/SET ":rtype: PatternFillEnum | T <= AbstractVectorLine

move(self, delta_x: float, delta_y: float)

move_backward(self, count: int=1)

move_forward(self, count: int=1)

move_to_back(self)

move_to_front(self)

name GET :rtype: str

records GET :rtype: dict[str, Record]

reset(self)

rotate(self, angle: float, origin: tuple=None)

Will rotate the object around it's own center point, relative to the drawing, not the plug-in!
:type origin: (float, float)

scale GET ``

title GET ``

FILE

d:\development\vw libraries\dlibrary\dlibrary\object.py

Updated