Property: allInstances
Gets a string array containing the instance locators for all possible physical instances of this object
SPArray allInstances();
Property: attributeList
Gets or sets the attribute list (i.e. the collection of all attribute values) associated with this object.
SPArray attributeList();
attributeList = SPArray
Returns or accepts an SPArray of DWAttribute objects
Property: circuit
Gets the circuit containing this object. Read-only
DWCircuit circuit();
Method: deleteAttribute
Deletes an attribute value in this object
void deleteAttribute(fieldName);
void deleteAttribute(fieldNum);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to delete |
fieldNum | int | The internal field number of the field to delete |
Method: detachedType
Gets an independent type definition for the device, with options for including instance modifications in the new type definition
DWType detachedType();
DWType detachedType(useInstCct);
DWType detachedType(useInstCct, useInstAttr);
DWType detachedType(useInstCct, useInstAttr, useInstSym);
DWType detachedType(useInstCct, useInstAttr, useInstSym, makePtFields);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
makePtFields | bool | If true, makes .Pt (attribute position) fields for all values displayed on the current instance. Defaults to true |
useInstCct | bool | If true, includes a copy of the internal circuit as defined for the current instance. Default to true |
useInstAttr | bool | If true, copies the attribute values currently set in the instance to be part of the new definition. Defaults to true |
useInstSym | bool | If true, uses the symbol as it appears for the current instance, including rotation. Defaults to true |
Returns a DWType object representing the device instance, opionally including any changes made to rotation, subcircuit or attributes.
NOTE: The DWType object returned by this method is a copy independent of the current design and can be edited as desired.
Property: detachedType
Gets an independent type definition representing the device as it currently appears in the circuit.
DWType detachedType();
Returns a DWType object representing the device instance including any changes made to rotation, subcircuit or attributes.
NOTE: The DWType object returned by this method is a copy independent of the current design and can be edited as desired.
Property: fillColor
Gets or sets the fill color for this device.
int fillColor();
fillColor = int
Returns an integer representing the color. Zero means no color (i.e. the default), 1 - 20 are the built-in system colors, any 32-bit number with the top bit set (0x80bbggrr) will be used as a 24-bit RGB color.
NOTE: When setting the color of a device, only filled shapes that are stored with the default background color (i.e. white) have the new color applied to them. Non-default fills are not affected.
This call does not modify the symbol definition, but only settings the drawing parameters for this particular device
Method: flip
Flip the device, similar to selecting the Flip Horizontal/Vertical commands
void flip(vert, keepConnections);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
keepConnections | bool | If true, the program will reroute lines as necessary to maintain connections to the device. If false, the device will be, in effect, cut and pasted back in the new orientation. Defaults to false |
vert | bool | If true, the device is flipped vertically, i.e. bottom to top. If false, the device is flipped left to right. Defaults to false; |
Property: frame
Gets a rectangle bounding the device.
Rect frame();
Method: getAttribute
Gets an attribute value from this object
String getAttribute(fieldName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to retrieve |
Returns a string representing the value of the specified attribute field. This string will be empty (zero length) if the field does not exist.
Method: getAttributeVis
Gets the visibility of an attribute on this object
bool getAttributeVis(fieldName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to retrieve |
Returns true if the field is displayed on the schematic, false otherwise
Method: getEMTPPhases
Gets the number of phases of all power signals attached to the device.
int getEMTPPhases();
Returns 3 for a 3-phase device, 1 for a device connected to 1-phase power signals only, 0 for a device with no power connections, -1 for an error or conflict.
Method: getInstanceLocatorInCircuit
Gets the instance locator for this device as if it was in the circuit whose instance locator is given
String getInstanceLocatorInCircuit(cctInstLoc);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
cctInstLoc | String | The instance locator of the desired parent circuit |
Method: getPinWindowPos
Returns the XY position of the point where the given pin touches the body of the device symbol. The point is returned in the coordinate system of the given window and is intended to assist in drawing symbol elements that are aligned with a pin
SPPoint = getPinWindowPos(pinNum, window);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
window | DWWindow | A window object representing the drawing port for the device symbol |
pinNum | int | The ordinal pin number of the desired pin, from 1..N |
Returns an SPPoint object that can be used to access the XY coordinates. These are given in the current coordinate system of the window
Method: getProperties
Gets a properties object associated with this object.
Property: instanceHierName
Gets or sets the selected physical instance of the circuit using its hierarchical name to identify it
String instanceHierName();
instanceHierName = String
The instance locator string identifies the currently selected unique physical instance of an object within a hierarchical circuit structure. Setting the instance locator does not change the locator of the definition object, it only selects one of the possible physical instances that can be represented by this definition. If the given instance locator is not valid for this definition, it is ignored. If it is valid and is different than the current selected instance and if the instance is in a displayed circuit, the display will be updated to reflect the change.
Property: instanceLocator
Gets or sets the selected physical instance of the circuit using its locator to identify it
String instanceLocator();
String instanceLocator(parentCctLocator);
instanceLocator = String
Parameters | ||
---|---|---|
Name | Expected Type | Description |
parentCctLocator | String | The instance locator of the parent circuit. If this is provided, it is used instead of the actual parent circuit to determine the instance locator. |
The instance locator string identifies the currently selected unique physical instance of this object within a hierarchical circuit structure. Setting the instance locator does not change the locator of the definition object, it only selects one of the possible physical instances that can be represented by this definition. If the given instance locator is not valid for this definition, it is ignored. If it is valid and is different than the current selected instance and if the instance is in a displayed circuit, the display will be updated to reflect the change.
Property: isInvisible
Gets or sets the "invisible" status of the device, i.e. whether the device is drawn on the screen
bool isInvisible();
isInvisible = bool
Property: isLocked
Gets the "locked" status of the device, i.e. whether it's subcircuit can be opened by the user.
bool isLocked();
This property is read-only
Property: isModelSubcct
Returns true if this device has a subcircuit and the subcircuit is marked as a "model" type, i.e. the subcircuit contents do not represent physical devices in the design but exist primarily to define the simulation function of the parent symbol.
bool isModelSubcct();
Property: isPhysicalSubcct
Returns true if this device has a subcircuit and the subcircuit is marked as a "physical" type, i.e. it represents physical devices in the design.
bool isPhysicalSubcct();
Property: isReadOnly
Gets the "read-only" status of the device, i.e. whether the device is in a read-only circuit
bool isReadOnly();
This property is read-only
Property: isSelected
Gets or sets the "selected" status of the device
bool isSelected();
isSelected = bool
Setting this value to true is equivalent to calling select(false, false);
Property: isUnique
Returns true if this device is unique, i.e. it is the only instance of its type, false if there are any other instances of the same type.
bool isUnique();
Property: lineColor
Gets or sets the line color for this device.
int lineColor();
lineColor = int
Returns an integer representing the color. Zero means no color (i.e. the default), 1 - 20 are the built-in system colors, any 32-bit number with the top bit set (0x80bbggrr) will be used as a 24-bit RGB color.
NOTE: When setting the color of a device, only lines that are stored with the default foreground color (i.e. black) have the new color applied to them. Non-default lines are not changed.
This call does not modify the symbol definition, but only settings the drawing parameters for this particular device
Property: locator
Gets the locator string of the circuit
String locator();
The locator string identifies an object within a hierarchical circuit structure and provides a unique way of identifying this object despite duplicate or non-existant names.
Method: makeUnique
Isolates the type definition of this device so that it is no longer the same as others that were created from the same library part. That is, updates or modifications to the original type will no longer affect this device.
bool makeUnique();
bool makeUnique(doChildren);
bool makeUnique(doChildren, doAllOfSameType);
bool makeUnique(doChildren, doAllOfSameType, newTypeName);
bool makeUnique(doChildren, doAllOfSameType, newTypeName, newPartName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
newPartName | String | The new contents for the Part attribute. If empty, no change is made. If the "doChildren" parameter is TRUE, this name only applies to the top level device, all child devices will retain their original name. Defaults to empty. |
newTypeName | String | The new name for the type definition, i.e. the name that will appear in the library part list. If empty, no change is made. If the "doChildren" parameter is TRUE, this name only applies to the top level device, all child devices will retain their original name. Defaults to empty. |
doAllOfSameType | bool | Pass true to apply the make unique operation to all devices that currently share the same type definition in this design. I.e. after this operation they will all share the new, isolated type definition. Defaults to false. |
doChildren | bool | Pass true to apply the make unique operation to all devices in this device's subcircuit and any nested subcircuits. Defaults to false. |
Returns true if operation succeeded, false if any error
Property: name
Gets the name of the device
String name();
This is a read-only property.
Property: numPins
Gets the number of pins on this device.
int numPins();
Property: objType
Returns a string with the name of this object class "DWDevice".
String = objType
Property: orientation
Get the device symbol's orientation.
char = orientation
A device's orientation is determined by a single character, which will be one of the following:
NORTH | N |
NORTHFLIP | n |
SOUTH | S |
SOUTHFLIP | s |
EAST | E |
EASTFLIP | e |
WEST | W |
WESTFLIP | w |
INVISIBLE | I |
Property: pageNum
Gets the page number that the device is located on in the circuit.
int pageNum();
Method: pins
Gets an array of DWPin objects representing the connections to the device.
DWArray pins();
Returns a DWArray object containing a DWPin object for each pin.
Property: posX
Get the device's X position on the diagram.
int = posX
Positions are measured in 1/1000"
Property: posY
Get the device's Y position on the diagram.
int = posY
Positions are measured in 1/1000"
Property: readOnly
Returns true if the circuit containing this object is marked "read only". Note that this status primarily affects the user interface and does not prevent script methods from making changes to the circuit.
bool = readOnly
Method: redraw
Causes the device to be redrawn on the schematic if it is visible.
void redraw();
Method: reloadScript
Causes the device script to be reloaded and recompiled the next time it is needed.
void reloadScript();
Method: remove
Removes (deletes) the associated device from its circuit.
void remove();
Any subsequent references to this DWDevice object will fail with an exception since the associated circuit object is gone.
Method: rotate
Rotate the device, similar to selecting the Rotate Right/Left commands
void rotate();
void rotate(rotation);
void rotate(rotation, keepConnections);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
keepConnections | bool | If true, the program will reroute lines as necessary to maintain connections to the device. If false, the device will be, in effect, cut and pasted back in the new orientation. Defaults to false |
rotation | int | The absolute orientation or relative rotation desired, in degrees, see comments below. This parameter is optional and defaults to -90 (rotate left 90) if not specified |
Method: rotateAttribute
Rotates the attribute text on the diagram
void rotateAttribute(fieldName, rotation);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to rotate |
rotation | int | The absolute orientation or relative rotation desired, in degrees, see comments below. This parameter is optional and defaults to -90 (rotate left 90) if not specified |
Method: select
Sets the associated device to be selected, as if the user had clicked on it.
void select();
void select(show);
void select(show, deselOthers);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
deselOthers | bool | Pass true to deselect all other circuit objects before selecting this one. Defaults to false. |
show | bool | Pass true to have the page containing the object opened and scrolled as needed to display it. Defaults to false. |
Method: setAttribute
Sets an attribute value in this object
void setAttribute(fieldName, value);
void setAttribute(fieldName, value, visibility);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The new value for the specified field |
fieldName | String | The name of the field to set |
visibility | int | How to set visibility of resulting attribute text. 0 (false) = hide, 1 (true) = show, 2 = use default setting in design's attribute table, -1 = leave current visibility If this parameter is not supplied, 2 is assumed. |
Null.
If the given field name is not defined in the design's attribute table, it is added automatically. It is preferable to ensure that any fields used are already defined in the target design to make sure the settings are appropriate.
Method: setAttributeVis
Sets the visibility of an attribute value in this object
void setAttributeVis(fieldName, visibility);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to set |
visibility | bool | true to make the attribute visible, false to hide it |
Property: signalNames
Gets a list of the names of signals attached to the device's pins, or sets the names of the attached signals from a given list.
signalNames = SPArray
SPArray = signalNames
SPArray = signalNames(excludeTemps);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
excludeTemps | bool | Set to true to include only user-assigned names, defaults to true |
Retrieving this property returns an SPArray object with each element being a string.
This property is intended for saving an restoring names of attached signals when deletting and replacing a device. When getting signal names, a name is left empty if it is invisible and has a default value. Similarly, on setting this property, the signal corresponding to an empty entry will be left unchanged.
Method: subCircuit
Gets a DWCircuit object representing the subcircuit of the device.
DWCircuit subCircuit();
Returns a DWCircuit object or null if the device has no subcircuit. The returned object represents the actual circuit in use in the design and should be modified with care.
Method: type
Gets or sets the type definition for the device.
DWType type();
type = DWType
void type(newType);
void type(newType, keepOldAttrPos);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
newType | DWType | New type to set this device to |
keepOldAttrPos | bool | True to keep all old attribute values and positions, true to take new values from the new type and calculate new positions. False by default |
Returns a DWType object representing the device type definition for this device.
NOTE: When retrieving the type of a device, the type definiton is locked because it is in use in the design. No changes can be made to the type. To get a copy of the type that can be edited, use detachedType
The type returned by this method is the type (symbol) definition used by the device and does not include any changes made to attributes or rotation in the circuit.
Setting a new value for a device's type effectively deletes and replaces the device, which may cause arbitrary connection and other changes in the circuit.
Property: window
Gets a DWWindow object that allows drawing on the device
DWWindow window();