Inherits: DesignItem < ScriptObject

Inherited by: AssociatedPart, Attribute, AttributeName, Callout, CamPlotItem, CommonSegment, CommonShape, Component, DiffPair, DiffPairChain, Document, Gate, Group, Layer, LayerClass, LibItem, LineStyle, Material, Net, NetClass, Node, Page, PartPin, PartRep, PredefinedShape, SignalPath, Symbol, SymbolInstance, TextPosition, TextStyle, TrackStyle, Variant

Design items are objects which exist in a Pulsonix document.

Instances of this class provide a way to access the objects on a document. Deleting instances of this class does not affect the original object. When the original object is deleted, instances of this class become invalid. This class provides access to attribute and attribute position functionality, but note that these features are not supported for all classes.

Properties

NameTypeGet/SetBrief
AttributePositionsArray[AttributePosition]Yes/NoThe list of attribute positions around this item.
AttributesArray[Attribute]Yes/NoThe list of attributes attached to this item.
ExtentsRectangleYes/NoThe rectangle defining the bounding box of this item.
LayerVariant[Layer, none]Yes/NoThe layer on which the item exists. Some subclasses allow this to be set as well.
LockedboolYes/YesWhether this item is locked.
NetVariant[Net, none]Yes/NoThe net on which this item is on, if there is one.
PositionPointYes/NoThe position of this item in DSUs. Items which do not have meaningful positions will always return 0, 0.
SelectedboolYes/YesWhether any part of this item is selected.

Methods

NameReturnsArguments
AddAttributeAttributename : str
value : str
AddAttributePositionAttributePositionattributeName : Variant[AttributeName, str]
position : Variant[Point, none]
layer : Variant[Layer, none]
DeleteAttributenoneattributeName : str
FindAttributePositionVariant[AttributePosition, none]attributeName : str
layer : Variant[Layer, none]
GetAttributeVariant[Attribute, none]name : Variant[AttributeName, str]
GetAttributeValueVariant[str, none]attributeName : Variant[AttributeName, str]
IsAttrVisibleboolattribute : Attribute
SetAttrNameVisiblenoneattributeName : str
set : bool
SetAttrVisiblenoneattribute : Attribute
set : bool
SetAttributenoneattributeName : Variant[AttributeName, str]
value : str

Property Details

AttributePositions

Type: Array[AttributePosition]

The list of attribute positions around this item.


Attributes

Type: Array[Attribute]

The list of attributes attached to this item.


Extents

Type: Rectangle

The rectangle defining the bounding box of this item.


Layer

Type: Variant[Layer, none]

The layer on which the item exists. Some subclasses allow this to be set as well.


Locked

Type: bool

Whether this item is locked.


Net

Type: Variant[Net, none]

The net on which this item is on, if there is one.


Position

Type: Point

The position of this item in DSUs. Items which do not have meaningful positions will always return 0, 0.


Selected

Type: bool

Whether any part of this item is selected.

Method Details

AddAttribute

Set the value of an attribute on this item, or add it if it doesn’t exist.

Returns Attribute.

Arguments:

  • name : str
  • value : str

AddAttributePosition

Add a new attribute position to an item.

Returns AttributePosition: The created attribute position.

Arguments:

  • attributeName : Variant[AttributeName, str] - The name of the attribute to add a position for.
  • position : Variant[Point, none] - Where to place the attribute position. The centre of the item is used if unspecified
  • layer : Variant[Layer, none] - The layer to place the attribute position on. The design default layer is used if unspecified.

DeleteAttribute

Remove an attribute from this item.

Arguments:

  • attributeName : str

FindAttributePosition

Find an attribute position on this item, only looking on a specific layer (if one is provided).

Returns Variant[AttributePosition, none].

Arguments:

  • attributeName : str
  • layer : Variant[Layer, none]

GetAttribute

Get the attribute with the given name if it is specifically on this item (i.e. without checking on parts if called on a component).

Returns Variant[Attribute, none].

Arguments:


GetAttributeValue

Retrieve the value of an attribute if it exists, even if the attribute is defined on a related item (i.e. on a component’s part).

Returns Variant[str, none].

Arguments:


IsAttrVisible

Whether a given attribute is visible on this item.

Returns bool.

Arguments:


SetAttrNameVisible

Sets whether an attribute name is visible on this item.

Arguments:

  • attributeName : str
  • set : bool

SetAttrVisible

Sets whether an attribute is visible on this item.

Arguments:


SetAttribute

Set the value of an attribute on this item.

Arguments: