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
| Name | Type | Get/Set | Brief |
|---|---|---|---|
| AttributePositions | Array[AttributePosition] | Yes/No | The list of attribute positions around this item. |
| Attributes | Array[Attribute] | Yes/No | The list of attributes attached to this item. |
| Extents | Rectangle | Yes/No | The rectangle defining the bounding box of this item. |
| Layer | Variant[Layer, none] | Yes/No | The layer on which the item exists. Some subclasses allow this to be set as well. |
| Locked | bool | Yes/Yes | Whether this item is locked. |
| Net | Variant[Net, none] | Yes/No | The net on which this item is on, if there is one. |
| Position | Point | Yes/No | The position of this item in DSUs. Items which do not have meaningful positions will always return 0, 0. |
| Selected | bool | Yes/Yes | Whether any part of this item is selected. |
Methods
| Name | Returns | Arguments |
|---|---|---|
| AddAttribute | Attribute | name : strvalue : str |
| AddAttributePosition | AttributePosition | attributeName : Variant[AttributeName, str]position : Variant[ Point, none]layer : Variant[Layer, none] |
| DeleteAttribute | none | attributeName : str |
| FindAttributePosition | Variant[AttributePosition, none] | attributeName : strlayer : Variant[Layer, none] |
| GetAttribute | Variant[Attribute, none] | name : Variant[AttributeName, str] |
| GetAttributeValue | Variant[str, none] | attributeName : Variant[AttributeName, str] |
| IsAttrVisible | bool | attribute : Attribute |
| SetAttrNameVisible | none | attributeName : strset : bool |
| SetAttrVisible | none | attribute : Attribute set : bool |
| SetAttribute | none | attributeName : 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:strvalue: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 unspecifiedlayer: 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:strlayer: 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:
name: Variant[AttributeName,str]
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:
attributeName: Variant[AttributeName,str]
IsAttrVisible
Whether a given attribute is visible on this item.
Returns bool.
Arguments:
attribute: Attribute
SetAttrNameVisible
Sets whether an attribute name is visible on this item.
Arguments:
attributeName:strset:bool
SetAttrVisible
Sets whether an attribute is visible on this item.
Arguments:
attribute: Attributeset:bool
SetAttribute
Set the value of an attribute on this item.
Arguments:
attributeName: Variant[AttributeName,str]value:str