Wiki
Clone wikiVW DLibrary / 2016 / api / document
MODULE dlibrary.document
Used for all document related stuff, like units, layers, resources, ....
CLASSES
builtins.object
........AbstractResourceList(builtins.object)
................RecordDefinitionResourceList(AbstractResourceList)
................SymbolDefinitionResourceList(AbstractResourceList)
........DataFieldTypeEnum(builtins.object)
........DefinitionTypeEnum(builtins.object)
........IAttributes(builtins.object)
................IClazzAttributes(IAttributes)
........................Clazz(dlibrary.object_base.AbstractKeyedObject, IClazzAttributes)
................IDocumentAttributes(IAttributes)
........................Document(IDocumentAttributes)
........IRecords(builtins.object)
........Layer(builtins.object)
................DesignLayer(Layer)
................SheetLayer(Layer)
........PatternFillEnum(builtins.object)
........PioFieldTypeEnum(builtins.object)
........RecordField(builtins.object)
........ResourceFolder(builtins.object)
........ResourceLocation(builtins.object)
........Units(builtins.object)
dlibrary.object_base.AbstractKeyedObject(builtins.object)
........AbstractResource(dlibrary.object_base.AbstractKeyedObject)
................RecordDefinition(AbstractResource)
................SymbolDefinition(AbstractResource, IRecords)
........AbstractVectorFill(dlibrary.object_base.AbstractKeyedObject)
................GradientVectorFill(AbstractVectorFill)
................HatchVectorFill(AbstractVectorFill)
................ImageVectorFill(AbstractVectorFill)
................TileVectorFill(AbstractVectorFill)
........AbstractVectorLine(dlibrary.object_base.AbstractKeyedObject)
................LineStyle(AbstractVectorLine)
........Clazz(dlibrary.object_base.AbstractKeyedObject, IClazzAttributes)
........Record(dlibrary.object_base.AbstractKeyedObject)
class AbstractResource(dlibrary.object_base.AbstractKeyedObject)
Class to represent a document resource.
> dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name, name: str='')
OBSOLETE name parameter. Will be removed and is now optional.
:type handle_or_name: vs.Handle | str
create_placeholder(name: str)
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class AbstractResourceList(builtins.object)
__init__(self, resource_type: int, abstract_resource: <built-in function callable>, location: int=0, folder: int=0, path: str='')
:type location: ResourceLocation
:type folder: ResourceFolder
get_abstract_resource_clazz(self) -> <built-in function callable>
get_resource(self, name: str) -> AbstractResource
id GET
``
is_resource_in_document(self, name: str) -> bool
is_resource_in_list(self, name: str) -> bool
names GET
``
remove_resource(self, name: str)
type GET
``
class AbstractVectorFill(dlibrary.object_base.AbstractKeyedObject)
Abstract base class for vector fills = fill resources.
> dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class AbstractVectorLine(dlibrary.object_base.AbstractKeyedObject)
Abstract base class for vector lines = line resources.
> dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class Clazz(dlibrary.object_base.AbstractKeyedObject, IClazzAttributes)
Class for working with class definitions.
> dlibrary.object_base.AbstractKeyedObject > IClazzAttributes > IAttributes > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
create(name: str)
Creates a new class with the given name.
:rtype: Clazz
fill GET/SET
:rtype: PatternFillEnum | T <= AbstractVectorFill
get_or_create(name: str)
Gets the class, creates if not found.
:rtype: Clazz
handle GET
:rtype: vs.Handle
line GET/SET
":rtype: PatternFillEnum | T <= AbstractVectorLine
name GET
:rtype: str
class DataFieldTypeEnum(builtins.object)
Holds all data field type constants. There are for data records and worksheets, not for PIO field types.
- BOOLEAN = 2
- INTEGER = 1
- NUMBER_ANGLE = 10
- NUMBER_DATETIME = 11
- NUMBER_DECIMAL = 5
- NUMBER_DIMENSION = 9
- NUMBER_DIMENSION_AREA = 14
- NUMBER_DIMENSION_VOLUME = 15
- NUMBER_FRACTIONAL = 8
- NUMBER_GENERAL = 3
- NUMBER_PERCENTAGE = 6
- NUMBER_SCIENTIFIC = 7
- TEXT = 4
class DefinitionTypeEnum(builtins.object)
SYMBOL_DEFINITION is OBSOLETE. Use ObjectTypeEnum from object_base!
- RECORD_DEFINITION = 47
- SYMBOL_DEFINITION = 16
class DesignLayer(Layer)
> Layer > builtins.object
__init__(self, handle: vs.Handle)
description GET
``
drawing_area GET
``
get(layer_handle)
name GET
For a sheet layer, VW calls this the number!
scale GET
``
class Document(IDocumentAttributes)
Class to represent the active document. Python scripts are always executed in context of the currently active document, that's why this is a singleton.
> IDocumentAttributes > IAttributes > builtins.object
design_layers GET
:rtype: set(DesignLayer)
filename GET
``
fill GET/SET
:rtype: PatternFillEnum | T <= AbstractVectorFill
layers GET
:rtype: set(Layer)
line GET/SET
":rtype: PatternFillEnum | T <= AbstractVectorLine
saved GET
``
sheet_layers GET
:rtype: set(SheetLayer)
text_size GET/SET
`Text size in points
:rtype: float`
class GradientVectorFill(AbstractVectorFill)
> AbstractVectorFill > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class HatchVectorFill(AbstractVectorFill)
> AbstractVectorFill > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class IAttributes(builtins.object)
Abstract interface for handling attributes.
fill GET/SET
:rtype: PatternFillEnum | T <= AbstractVectorFill
line GET/SET
":rtype: PatternFillEnum | T <= AbstractVectorLine
class IClazzAttributes(IAttributes)
Interface for handling class attributes.
> IAttributes > builtins.object
fill GET/SET
:rtype: PatternFillEnum | T <= AbstractVectorFill
line GET/SET
":rtype: PatternFillEnum | T <= AbstractVectorLine
class IDocumentAttributes(IAttributes)
Interface for handling document attributes.
> IAttributes > builtins.object
fill GET/SET
:rtype: PatternFillEnum | T <= AbstractVectorFill
line GET/SET
":rtype: PatternFillEnum | T <= AbstractVectorLine
class IRecords(builtins.object)
Interface that handles attached records.
records GET
:rtype: dict[str, Record]
class ImageVectorFill(AbstractVectorFill)
> AbstractVectorFill > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class Layer(builtins.object)
__init__(self, handle: vs.Handle)
description GET
``
drawing_area GET
``
get(layer_handle)
name GET
For a sheet layer, VW calls this the number!
class LineStyle(AbstractVectorLine)
> AbstractVectorLine > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class PatternFillEnum(builtins.object)
Holds the most important pattern fill indices in a human readable name. These are No fill, background color fill and foreground color fill. It is recommended to not use any other fills anymore, as there are several issues with them, especially with printing.
- BACKGROUND_COLOR = 1
- FOREGROUND_COLOR = 2
- NONE = 0
class PioFieldTypeEnum(builtins.object)
Holds all data field type constants for PIO fields.
- BOOLEAN = 2
- INTEGER = 1
- REAL = 3
- REAL_DIMENSION = 7
- REAL_X_COORDINATE = 10
- REAL_Y_COORDINATE = 11
- TEXT = 4
- TEXT_CLASS_POPUP = 18
- TEXT_POPUP = 8
- TEXT_RADIO_BUTTON = 9
- TEXT_STATIC = 14
class Record(dlibrary.object_base.AbstractKeyedObject)
Class to represent a record instance, aka attached record.
> dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle: vs.Handle, object_handle: vs.Handle)
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 RecordDefinition(AbstractResource)
Class to represent a record definition.
> AbstractResource > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name, name: str='')
OBSOLETE name parameter. Will be removed and is now made optional.
:type handle_or_name: vs.Handle | str
create_placeholder(name: str)
fields GET
``
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class RecordDefinitionResourceList(AbstractResourceList)
> AbstractResourceList > builtins.object
__init__(self, location: int=0, folder: int=0, path: str='')
:type location: ResourceLocation
:type folder: ResourceFolder
get_abstract_resource_clazz(self) -> <built-in function callable>
get_resource(self, name: str) -> AbstractResource
id GET
``
is_resource_in_document(self, name: str) -> bool
is_resource_in_list(self, name: str) -> bool
names GET
``
remove_resource(self, name: str)
type GET
``
class RecordField(builtins.object)
Class to handle record instance fields.
__init__(self, record_handle: vs.Handle, index: int, record_name: str, object_handle: vs.Handle, parametric: bool)
name GET
:rtype: str
type GET
:rtype: DataFieldTypeEnum | PioFieldTypeEnum
value GET/SET
:rtype: str | int | bool | float
class ResourceFolder(builtins.object)
"Constants for all possible application resource folders.
- DEFAULTS = 14
- NONE = 0
class ResourceLocation(builtins.object)
"Constants that reflect where to get the asked resources from.
- APP = -1
- DOC = 0
- DOC_APP = 1
class SheetLayer(Layer)
> Layer > builtins.object
__init__(self, handle: vs.Handle)
description GET
``
drawing_area GET
``
get(layer_handle)
name GET
For a sheet layer, VW calls this the number!
title GET
``
class SymbolDefinition(AbstractResource, IRecords)
Class to represent a symbol definition.
> AbstractResource > dlibrary.object_base.AbstractKeyedObject > IRecords > builtins.object
__init__(self, handle_or_name, name: str='')
OBSOLETE name parameter. This will be removed and is now optional.
:type handle: vs.Handle | str
create_placeholder(name: str)
get_by_name(name: str)
OBSOLETE. Use ObjectRepository().get(handle_or_name) from object_base instead.
handle GET
:rtype: vs.Handle
name GET
:rtype: str
place_symbol(self, insertion_point: tuple, rotation: float)
OBSOLETE, use Symbol.create instead!
records GET
:rtype: dict[str, Record]
class SymbolDefinitionResourceList(AbstractResourceList)
> AbstractResourceList > builtins.object
__init__(self, location: int=0, folder: int=0, path: str='')
:type location: ResourceLocation
:type folder: ResourceFolder
get_abstract_resource_clazz(self) -> <built-in function callable>
get_resource(self, name: str) -> AbstractResource
id GET
``
is_resource_in_document(self, name: str) -> bool
is_resource_in_list(self, name: str) -> bool
names GET
``
remove_resource(self, name: str)
type GET
``
class TileVectorFill(AbstractVectorFill)
> AbstractVectorFill > dlibrary.object_base.AbstractKeyedObject > builtins.object
__init__(self, handle_or_name)
:type handle_or_name: vs.Handle | str
handle GET
:rtype: vs.Handle
name GET
:rtype: str
class Units(builtins.object)
length_precision GET
:rtype: int
resolve_length_units(dimension)
Will return the same, but length unit strings will be transformed to floats.
For a float or str dimension, this will return a float.
For a tuple, which would be a point, this will return a tuple of floats.:type dimension: float | str | tuple
:rtype: float | tuple
to_area_string(araa_in_area_units: float, with_unit_mark: bool=False) -> str
to_area_units(area_in_square_inches: float) -> float
to_cubic_inches(volume_in_volume_units: float) -> float
to_inches(length_in_length_units_or_str: float) -> float
:type length_in_length_units_or_str: float || str
to_length_string(length_in_length_units: float, with_unit_mark: bool=False) -> str
to_length_units(length_in_inches_or_str: float) -> float
:type length_in_inches_or_str: float || str
to_square_inches(area_in_area_units: float) -> float
to_volume_string(volume_in_volume_units: float, with_unit_mark: bool=False) -> str
to_volume_units(volume_in_cubic_inches: float) -> float
FILE
d:\development\vw libraries\dlibrary\dlibrary\document.py
Updated