Item

copyObject

copyObject(["name"]) -> string

Copies the specified object or first item of selection if "name" is not given. Deprecated. Use copyObjects instead.

copyObjects

copyObjects([names])

Copies the specified objects or the current object selection if no item names are given. The names of objects to copy can be provided as a string for copying a single object or as a list of strings to copy several objects at once.

deleteObject

deleteObject(["name"])

Deletes the item with the name "name". If "name" is not given the currently selected item is deleted.

duplicateObject

duplicateObject(["name"]) -> string

Creates a duplicate of the specified object or of first item of selection if "name" is not given. Returns name of new object. Deprecated. Use duplicateObjects() instead.

duplicateObjects

duplicateObjects([names]) -> list

Creates a duplicate of the specified objects or of the current selection if no names are given. The names of objects to duplicate can be provided as a string to duplicate a single object or as a list of strings to duplicate several objects at once. Returns a list of the names of the newly created objects.

getItemPageNumber

getItemPageNumber([name])

Returns the page number for the given page item.

getProperty

getProperty(object, property)

Return the value of the property 'property' of the passed 'object'.

The 'object' argument may be a string, in which case the named PageItem is searched for. It may also be a PyCObject, which may point to any C++ QObject instance.

The 'property' argument must be a string, and is the name of the property to look up on 'object'.

The return value varies depending on the type of the property.

getPropertyCType

getPropertyCType(object, property, includesuper=True)

Returns the name of the C type of 'property' of 'object'. See getProperty() for details of arguments.

If 'includesuper' is true, search inherited properties too.

getPropertyNames

getPropertyNames(object, includesuper=True)

Return a list of property names supported by 'object'. If 'includesuper' is true, return properties supported by parent classes as well.

groupObjects

groupObjects(list) -> string

Groups the objects named in "list" together. "list" must contain the names of the objects to be grouped. If "list" is not given the currently selected items are used. Returns the group name for further referencing.

objectExists

objectExists(["name"]) -> bool

Test if an object with specified name really exists in the document. The optional parameter is the object name. When no object name is given, returns True if there is something selected.

pasteObject

pasteObject() -> string

Pastes an object from the clipboard. This will be used only or most sensibly following copyObject(...), since otherwise there will likely be nothing in the clipboard to paste. Returns the names of the newly created object in a comma separated string. Deprecated. Use pasteObjects() instead.

pasteObjects

pasteObjects() -> list

Pastes the content of clipboard to canvas. This will be used only or most sensibly following copyObjects(...), since otherwise there will likely be nothing in the clipboard to paste. Returns the names of the newly created object in a list.

scaleGroup

scaleGroup(factor [,"name"])

Scales the group the object "name" belongs to. Values greater than 1 enlarge the group, values smaller than 1 make the group smaller e.g a value of 0.5 scales the group to 50 % of its original size, a value of 1.5 scales the group to 150 % of its original size. The value for "factor" must be greater than 0. If "name" is not given the currently selected item is used.

May raise ValueError if an invalid scale factor is passed.

setEditMode

setEditMode()

Start the edit mode for the current item.

setitemname

setitemname(newName, ["name"])

Sets the name of object "name" to newName and returns the name applied. If "name" is not given the currently selected item is used.

May raise NotFoundError if the object doesn't exist.

setNormalMode

setNormalMode()

Set the current item in normal mode (out of edit mode).

setProperty

setProperty(object, property, value)

Set 'property' of 'object' to 'value'. If 'value' cannot be converted to a type compatible with the type of 'property', an exception is raised. An exception may also be raised if the underlying setter fails.

See getProperty() for more information.

unGroupObjects

unGroupObjects("name")

Destructs the group the object "name" belongs to.If "name" is not given the currently selected item is used.

Constants

Item types

  • ITEMTYPE_ARC
  • ITEMTYPE_GROUP
  • ITEMTYPE_IMAGEFRAME
  • ITEMTYPE_ITEMTYPE1
  • ITEMTYPE_ITEMTYPE3
  • ITEMTYPE_LATEXFRAME
  • ITEMTYPE_LINE
  • ITEMTYPE_MULTIPLE
  • ITEMTYPE_NOTEFRAME
  • ITEMTYPE_OSGFRAME
  • ITEMTYPE_PATHTEXT
  • ITEMTYPE_POLYGON
  • ITEMTYPE_POLYLINE
  • ITEMTYPE_REGULARPOLYGON
  • ITEMTYPE_SPIRAL
  • ITEMTYPE_SYMBOL
  • ITEMTYPE_TABLE
  • ITEMTYPE_TEXTFRAME