Device Extension / BaseDevice

If you plan to write a device specific integration then this is the correct page for you.

The sp.BaseDevice supports events, actions as well as all structures for the viewport. - Receive commands and/or data within Grid. - Send commands and/or data from Grid. - Supports user data - Supports child objects within the project tree - Can be visualized within the viewport / 3D space

import sp

class Device_Plugin(sp.BaseDevice):

    def __init__(self):
        sp.BaseDevice.__init__(self)

if __name__ == "__main__":
	sp.registerPlugin(Device_Plugin)

Main Class

The class name Device_Plugin can be customized and also represent the name of your Plugin.

class Device_Plugin(sp.BaseDevice):

While (sp.BaseDevice) can´t be renamed.

Initialization

Within your Main Class it´s necessary to define a function for the initialization:

    def __init__(self):
        sp.BaseDevice.__init__(self)

Register

To register the plugin you need the following lines of code outside of your Main Class:

if __name__ == "__main__":
	sp.registerPlugin(Device_Plugin)

Last updated