Wiki

Clone wiki

VW DLibrary / 2016 / api / vectorworks

MODULE dlibrary.vectorworks

Module for all Vectorworks related stuff, like settings and active plug-in features.

CLASSES

builtins.object
........AbstractActivePlugInParameters(builtins.object)
........AbstractResetArgs(builtins.object)
................CreationResetArgs(AbstractResetArgs)
................EmptyResetArgs(AbstractResetArgs)
................ParameterChangedResetArgs(AbstractResetArgs)
........AbstractWidget(builtins.object)
................ButtonWidget(AbstractWidget)
................ParameterWidget(AbstractWidget)
................SeparatorWidget(AbstractWidget)
................StaticTextWidget(AbstractWidget)
........ActivePlugIn(builtins.object)
........ActivePlugInDoubleClickBehaviour(builtins.object)
........ActivePlugInEvent(builtins.object)
........ActivePlugInFontStyleEnabled(builtins.object)
........ActivePlugInInfo(builtins.object)
........ActivePlugInInfoPallet(builtins.object)
........ActivePlugInOnEvent(builtins.object)
........ActivePlugInOnReset(builtins.object)
........ActivePlugInType(builtins.object)
........DoubleClickBehaviour(builtins.object)
........PlatformEnum(builtins.object)
........Security(builtins.object)
........Vectorworks(builtins.object)
dlibrary.utility.AbstractXmlFile(builtins.object)
........AbstractActivePlugInDrawingXmlFile(dlibrary.utility.AbstractXmlFile)
........AbstractActivePlugInXmlFile(dlibrary.utility.AbstractXmlFile)
................AbstractActivePlugInPrefsXmlFile(AbstractActivePlugInXmlFile)


class AbstractActivePlugInDrawingXmlFile(dlibrary.utility.AbstractXmlFile)

> dlibrary.utility.AbstractXmlFile > builtins.object

__init__(self)

load(self, create_if_not_found: bool=False) -> dict

path GET ``

save(self, content: dict)


class AbstractActivePlugInParameters(builtins.object)

Vectorworks will always give you the initial values of parameters. So when changing them inside your script, you'll still get the initial values. Therefore we'll create some sort of cache to remember the current values.

__init__(self)


class AbstractActivePlugInPrefsXmlFile(AbstractActivePlugInXmlFile)

> AbstractActivePlugInXmlFile > dlibrary.utility.AbstractXmlFile > builtins.object

__init__(self, active_plugin_type: str)

:type active_plugin_type: ActivePlugInType(Enum)

load(self, create_if_not_found: bool=False) -> dict

path GET ``

save(self, content: dict)


class AbstractActivePlugInXmlFile(dlibrary.utility.AbstractXmlFile)

> dlibrary.utility.AbstractXmlFile > builtins.object

__init__(self, active_plugin_type: str, suffix: str)

:type active_plugin_type: ActivePlugInType(Enum)

load(self, create_if_not_found: bool=False) -> dict

path GET ``

save(self, content: dict)


class AbstractResetArgs(builtins.object)


class AbstractWidget(builtins.object)

Abstract base class for object info pallet widgets.

__init__(self, visible: <built-in function callable>=None)

:type visible: () -> bool

add_to_info_pallet(self, widget_id: int)

Adds the widget to the object info pallet, giving it an id.

custom_visibility GET :rtype: bool

update(self, widget_id: int)

Will be called internally to update the visibility status of the widget, if it has custom visibility.
The widget_id is given, as I couldn't find a solution to save it here, for some reason it didn't work. -Dieter.


class ActivePlugIn(builtins.object)

__init__(self)

handle GET ``

name GET ``

origin GET :rtype: (float, float)

parameters GET ``

rotation GET :rtype: float

version GET/SET ``


class ActivePlugInDoubleClickBehaviour(builtins.object)

Decorator to set the double click behaviour for an event-enabled plug-in.

__init__(self, behaviour: int=0, callback: <built-in function callable>=None)

:type behaviour: DoubleClickBehaviour
:type callback: (self) -> None || () -> None


class ActivePlugInEvent(builtins.object)

  • VSO_ON_ADD_STATE = 44
  • VSO_ON_DOUBLE_CLICK = 7
  • VSO_ON_INITIALIZATION = 5
  • VSO_ON_RESET = 3
  • VSO_ON_WIDGET_CLICK = 35
  • VSO_ON_WIDGET_PREP = 41

class ActivePlugInFontStyleEnabled(builtins.object)

Decorator for setting the plug-in font style enabled.


class ActivePlugInInfo(builtins.object)

Decorator to initialize the active plugin. This should be used on the main run method of the plugin!

__init__(self, version: str)


class ActivePlugInInfoPallet(builtins.object)

Decorator for setting the info pallet for an event-enabled plug-in.

__init__(self, widgets: list)

:type widgets: list[AbstractWidget]


class ActivePlugInOnEvent(builtins.object)

Decorator for setting an event callback for an event-enabled plug-in.

__init__(self, event: int, callback: <built-in function callable>)

:type callback: (self, int) -> None || (int) -> None


class ActivePlugInOnReset(builtins.object)

Decorator for setting a reset callback for an event-enabled plug-in.

__init__(self, callback: <built-in function callable>, with_args: bool=False)

:type callback: (self, AbstractResetArgs) -> None || (AbstractResetArgs) -> None


class ActivePlugInType(builtins.object)

  • MENU = .vsm
  • OBJECT = .vso
  • TOOL = .vst

class ButtonWidget(AbstractWidget)

> AbstractWidget > builtins.object

__init__(self, text: str, on_click: <built-in function callable>, reset: bool=False, visible: <built-in function callable>=None)

:param reset: If true, the pio instance will be reset after the on_click def.
:type visible: () -> bool

add_to_info_pallet(self, widget_id: int)

custom_visibility GET :rtype: bool

on_click GET ``

update(self, widget_id: int)

Will be called internally to update the visibility status of the widget, if it has custom visibility.
The widget_id is given, as I couldn't find a solution to save it here, for some reason it didn't work. -Dieter.


class CreationResetArgs(AbstractResetArgs)

> AbstractResetArgs > builtins.object


class DoubleClickBehaviour(builtins.object)

  • CUSTOM_EVENT = 1
  • DEFAULT = 0
  • PROPERTIES_DIALOG = 2
  • RESHAPE_MODE = 3

class EmptyResetArgs(AbstractResetArgs)

> AbstractResetArgs > builtins.object


class ParameterChangedResetArgs(AbstractResetArgs)

> AbstractResetArgs > builtins.object

__init__(self, index: int)

name GET ``


class ParameterWidget(AbstractWidget)

> AbstractWidget > builtins.object

__init__(self, parameter: str, visible: <built-in function callable>=None)

:type visible: () -> bool

add_to_info_pallet(self, widget_id: int)

custom_visibility GET :rtype: bool

update(self, widget_id: int)

Will be called internally to update the visibility status of the widget, if it has custom visibility.
The widget_id is given, as I couldn't find a solution to save it here, for some reason it didn't work. -Dieter.


class PlatformEnum(builtins.object)

Enum to identify the platform Vectorworks is running on.

  • MAC_OS = 1
  • WINDOWS = 2

class Security(builtins.object)

Decorator to secure a function based on the dongle and VW version running. Make sure you use this as the topmost decorator in order for the check to be the first thing that will happen! If your plugin is event enabled, then make sure that you have the following order: @ActivePlugInInfo @ActivePlugInSetup > before security, as we'll setup the info pallet here! @Security @ActivePlugInEvents This is because everything under @Security will not run if the user has no permission!

__init__(self, version: str, dongles: set=None)


class SeparatorWidget(AbstractWidget)

> AbstractWidget > builtins.object

__init__(self, text: str='', visible: <built-in function callable>=None)

:type visible: () -> bool

add_to_info_pallet(self, widget_id: int)

custom_visibility GET :rtype: bool

update(self, widget_id: int)

Will be called internally to update the visibility status of the widget, if it has custom visibility.
The widget_id is given, as I couldn't find a solution to save it here, for some reason it didn't work. -Dieter.


class StaticTextWidget(AbstractWidget)

> AbstractWidget > builtins.object

__init__(self, text: str='', visible: <built-in function callable>=None)

:type visible: () -> bool

add_to_info_pallet(self, widget_id: int)

custom_visibility GET :rtype: bool

update(self, widget_id: int)

Will be called internally to update the visibility status of the widget, if it has custom visibility.
The widget_id is given, as I couldn't find a solution to save it here, for some reason it didn't work. -Dieter.


class Vectorworks(builtins.object)

Singleton class to represent the running Vectorworks instance.

clear_message()

dongle GET ``

get_file_path_of_active_document(self) -> str

get_folder_path_of_active_document(self) -> str

get_folder_path_of_plugin_file(self, filename: str) -> str

platform GET ``

show_message(message: str)

version GET `Vectorworks' main version, like '12.5', or '2016'.

:rtype: str`

FILE

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

Updated