IPCB_Primitive interface
The base interface of the PCB design objects; tracks, arcs, pads, vias, fills, text, components, polygons, dimensions and the other PCB object interfaces inherit its members.
public interface IPCB_Primitive
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Derived: IPCB_Accordion, IPCB_Arc, IPCB_Board, IPCB_Connection, IPCB_DifferentialPair, IPCB_DrillTable, IPCB_Embedded, IPCB_FromTo, IPCB_Group, IPCB_ObjectClass, IPCB_ObjectClassBase, IPCB_Pad, IPCB_RectangularPrimitive, IPCB_Region, IPCB_Rule, IPCB_Track, IPCB_Via, IPCB_Violation
Remarks
Coordinates and sizes are in internal units (10,000 per mil): 10,000 per mil (EDP.EDPConstant.InternalUnits). Convert with EDP.Utils.MilsToCoord and EDP.Utils.MMsToCoord, and back with EDP.Utils.CoordToMils and EDP.Utils.CoordToMMs.
To change an object, call BeginModify before and EndModify after the change, between IPCB_ServerInterface.PreProcess and IPCB_ServerInterface.PostProcess.
Once the object has been destroyed, every call through this interface fails with the error "Object accessed after being destroyed".
A primitive has a bounding rectangle which encapsulates the region of the primitive. There are two other bounding rectangles which are for selection and for painting (refreshing and updating).
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| AllowGlobalEdit | bool | get; set | |
| Board | IPCB_Board | get; set | The Board property determines the PCB document that the object itself is associated with. |
| Component | IPCB_Component | get; set | This property determines whether the object itself is associated with the component or not. |
| Coordinate | IPCB_Coordinate | get; set | The Coordinate property returns the IPCB_Coordinate only if this object itself is part of the IPCB_Coordinate type. |
| DescriptorString | string | get | The Descriptor read only property fetches the Descriptor string. |
| DetailString | string | get | This property retrieves the Detail text string for this design object. |
| Dimension | IPCB_Dimension | get; set | The dimension the object belongs to, or null when it is not part of a dimension. |
| DrawAsPreview | bool | get; set | |
| DRCError | bool | get; set | The DRCError property determines whether the object is affected by the Design Rule Checker and thus if the object breaks one of the design rules, the DRCError is true. |
| Enabled | bool | get; set | |
| Enabled_Direct | bool | get; set | |
| Enabled_vComponent | bool | get; set | |
| Enabled_vCoordinate | bool | get; set | |
| Enabled_vDimension | bool | get; set | |
| Enabled_vNet | bool | get; set | |
| Enabled_vPolygon | bool | get; set | |
| EnableDraw | bool | get; set | |
| Handle | string | get | |
| Identifier | string | get | |
| InBoard | bool | get; set | This InBoard property determines whether the object itself is part of the board object or not. |
| InComponent | bool | get; set | This InComponent property determines whether the object itself is part of the component object or not. |
| InCoordinate | bool | get; set | This InCoordinate property determines whether the object itself is part of the coordinate object or not. |
| Index | ushort | get; set | |
| InDimension | bool | get; set | This InDimension property determines whether the object itself is part of the dimension object or not. |
| InNet | bool | get; set | |
| InPolygon | bool | get; set | This InPolygon property determines whether the object itself is part of the polygon object or not. |
| InSelectionMemory | bool | get; set | |
| IsAssyTestPoint_Bottom | bool | get; set | |
| IsAssyTestPoint_Top | bool | get; set | |
| IsElectricalPrim | bool | get | This property determines whether this PCB object possesses an electrical property- tracks, fills, polygons, arcs, vias all have electrical properties - basically those objects that have a Net propert… |
| IsKeepout | bool | get; set | This property determines whether a PCB object is used as a keep-out object. |
| IsPreRoute | bool | get; set | |
| IsTenting | bool | get; set | This property determines whether the solder mask of pad and via objects are tented on top and bottom layers. |
| IsTenting_Bottom | bool | get; set | This property determines whether the solder mask of pad and via objects are tented or not on the bottom layer. |
| IsTenting_Top | bool | get; set | This property determines whether the solder mask of pad and via objects are tented or not on the top layer. |
| IsTestPoint_Bottom | bool | get; set | |
| IsTestPoint_Top | bool | get; set | |
| Layer | TV6_Layer | get; set | The layer the object is on, as a TV6_Layer. |
| MiscFlag1 | bool | get; set | This property determines the boolean value from the MiscFlag1 property and can be used for custom purposes. |
| MiscFlag2 | bool | get; set | This property determines the boolean value from the MiscFlag2 property and can be used for custom purposes. |
| MiscFlag3 | bool | get; set | This property determines the boolean value from the MiscFlag3 property and can be used for custom purposes. |
| Moveable | bool | get; set | This property determines whether this design object can be moved or not (by the autorouter for example). |
| Net | IPCB_Net | get; set | The Net property of an object denotes it has an electrical property, meaning it is connected from one node to another. |
| ObjectID | TObjectId | get | |
| ObjectIDString | string | get | This ObjectIDString property returns the Object Id string. |
| PadCacheRobotFlag | bool | get; set | Not used; the property reads false, and setting it has no effect. |
| PasteMaskExpansion | int | get | The paste mask expansion of the object, in internal units (10,000 per mil). |
| Polygon | IPCB_Polygon | get; set | This method retrieves the IPCB_Polygon interface that the design object primitive is associated with. |
| PolygonOutline | bool | get; set | This method determines whether the design object primitive is part of the polygon outline or not. |
| PowerPlaneClearance | int | get | The power plane clearance of the object, in internal units (10,000 per mil). |
| PowerPlaneConnectStyle | TPlaneConnectStyle | get | The style of the object's connection to power planes. |
| PowerPlaneReliefExpansion | int | get | The relief expansion of the object's power plane connection, in internal units (10,000 per mil). |
| Preview | float | set | |
| ReliefAirGap | int | get | The ReliefAirGap property retrieves the relief air gap value for this pad/via object, in internal units (10,000 per mil). |
| ReliefConductorWidth | int | get | The relief conductor width of the pad or via, in internal units (10,000 per mil). |
| ReliefEntries | int | get | This property retrieves the number of relief entries for a pad/via object. |
| Selected | bool | get; set | This property determines whether this object is selected or not on the PCB document. |
| SolderMaskExpansion | int | get | The solder mask expansion of the object, in internal units (10,000 per mil). |
| TearDrop | bool | get; set | This property determines whether the PCB object (an arc or track object) is used for as a tear drop. |
| UnionIndex | int | get; set | The property denotes the union index. |
| UniqueId | string | get | |
| UniqueID | string | set | |
| Used | bool | get; set | |
| UserRouted | bool | get; set | |
| V7Layer | V7_LayerBase | get; set | The layer the object is on. |
| ViewableObjectID | TViewableObjectID | get | The read only property determines the ViewableObjectID of the design object. |
AllowGlobalEdit
No description yet.
bool GetState_AllowGlobalEdit();
void SetState_AllowGlobalEdit(bool argValue);
Type: bool · Access: read/write
Board
The Board property determines the PCB document that the object itself is associated with.
IPCB_Board GetState_Board();
void SetState_Board(IPCB_Board argBoard);
Type: IPCB_Board · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
Examples: Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent
Component
This property determines whether the object itself is associated with the component or not.
IPCB_Component GetState_Component();
void SetState_Component(IPCB_Component argValue);
Type: IPCB_Component · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
Coordinate
The Coordinate property returns the IPCB_Coordinate only if this object itself is part of the IPCB_Coordinate type. A coordinate object is a group object and is composed of design object primitives such as tracks, arcs and text objects.
IPCB_Coordinate GetState_Coordinate();
void SetState_Coordinate(IPCB_Coordinate argValue);
Type: IPCB_Coordinate · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
DescriptorString
The Descriptor read only property fetches the Descriptor string.
string GetState_DescriptorString();
Type: string · Access: read-only
DetailString
This property retrieves the Detail text string for this design object.
string GetState_DetailString();
Type: string · Access: read-only
Dimension
The dimension the object belongs to, or null when it is not part of a dimension.
IPCB_Dimension GetState_Dimension();
void SetState_Dimension(IPCB_Dimension argValue);
Type: IPCB_Dimension · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
DrawAsPreview
No description yet.
bool GetState_DrawAsPreview();
void SetState_DrawAsPreview(bool argValue);
Type: bool · Access: read/write
DRCError
The DRCError property determines whether the object is affected by the Design Rule Checker and thus if the object breaks one of the design rules, the DRCError is true.
bool GetState_DRCError();
void SetState_DRCError(bool argValue);
Type: bool · Access: read/write
Enabled
No description yet.
bool GetState_Enabled();
void SetState_Enabled(bool argValue);
Type: bool · Access: read/write
Enabled_Direct
No description yet.
bool GetState_Enabled_Direct();
void SetState_Enabled_Direct(bool argValue);
Type: bool · Access: read/write
Enabled_vComponent
No description yet.
bool GetState_Enabled_vComponent();
void SetState_Enabled_vComponent(bool argValue);
Type: bool · Access: read/write
Enabled_vCoordinate
No description yet.
bool GetState_Enabled_vCoordinate();
void SetState_Enabled_vCoordinate(bool argValue);
Type: bool · Access: read/write
Enabled_vDimension
No description yet.
bool GetState_Enabled_vDimension();
void SetState_Enabled_vDimension(bool argValue);
Type: bool · Access: read/write
Enabled_vNet
No description yet.
bool GetState_Enabled_vNet();
void SetState_Enabled_vNet(bool argValue);
Type: bool · Access: read/write
Enabled_vPolygon
No description yet.
bool GetState_Enabled_vPolygon();
void SetState_Enabled_vPolygon(bool argValue);
Type: bool · Access: read/write
EnableDraw
No description yet.
bool GetState_EnableDraw();
void SetState_EnableDraw(bool argValue);
Type: bool · Access: read/write
Handle
No description yet.
string GetState_Handle();
Type: string · Access: read-only
Identifier
No description yet.
string GetState_Identifier();
Type: string · Access: read-only
InBoard
This InBoard property determines whether the object itself is part of the board object or not.
bool GetState_InBoard();
void SetState_InBoard(bool argValue);
Type: bool · Access: read/write
InComponent
This InComponent property determines whether the object itself is part of the component object or not.
bool GetState_InComponent();
void SetState_InComponent(bool argValue);
Type: bool · Access: read/write
InCoordinate
This InCoordinate property determines whether the object itself is part of the coordinate object or not.
bool GetState_InCoordinate();
void SetState_InCoordinate(bool argValue);
Type: bool · Access: read/write
Index
No description yet.
ushort GetState_Index();
void SetState_Index(ushort argIndex);
Type: ushort · Access: read/write
InDimension
This InDimension property determines whether the object itself is part of the dimension object or not.
bool GetState_InDimension();
void SetState_InDimension(bool argValue);
Type: bool · Access: read/write
InNet
No description yet.
bool GetState_InNet();
void SetState_InNet(bool argValue);
Type: bool · Access: read/write
InPolygon
This InPolygon property determines whether the object itself is part of the polygon object or not.
bool GetState_InPolygon();
void SetState_InPolygon(bool argValue);
Type: bool · Access: read/write
InSelectionMemory
No description yet.
bool GetState_InSelectionMemory(int argIndex);
void SetState_InSelectionMemory(int argIndex, bool argValue);
Type: bool · Access: read/write · Index: argIndex (int): The selection memory, from 0 to 7.
Setting the property for an index outside 0 to 7 has no effect.
IsAssyTestPoint_Bottom
No description yet.
bool GetState_IsAssyTestPoint_Bottom();
void SetState_IsAssyTestPoint_Bottom(bool argValue);
Type: bool · Access: read/write
IsAssyTestPoint_Top
No description yet.
bool GetState_IsAssyTestPoint_Top();
void SetState_IsAssyTestPoint_Top(bool argValue);
Type: bool · Access: read/write
IsElectricalPrim
This property determines whether this PCB object possesses an electrical property- tracks, fills, polygons, arcs, vias all have electrical properties - basically those objects that have a Net property will possess an electrical property.
bool GetState_IsElectricalPrim();
Type: bool · Access: read-only
Embedded boards and Embedded objects etc don't have an electrical property for example.
IsKeepout
This property determines whether a PCB object is used as a keep-out object. Currently arc, track and fill objects are used as keep out objects. The keepout layer generally defines areas on the PCB document that you don't want automatically or manually routed, and this can include clearance areas around mounting hole pads or high voltage components for example.
bool GetState_IsKeepout();
void SetState_IsKeepout(bool argValue);
Type: bool · Access: read/write
IsPreRoute
No description yet.
bool GetState_IsPreRoute();
void SetState_IsPreRoute(bool argB);
Type: bool · Access: read/write
IsTenting
This property determines whether the solder mask of pad and via objects are tented on top and bottom layers. A tenting closes an opening in the mask of pad or via objects.
bool GetState_IsTenting();
void SetState_IsTenting(bool argValue);
Type: bool · Access: read/write
IsTenting_Bottom
This property determines whether the solder mask of pad and via objects are tented or not on the bottom layer. A tenting closes an opening in the mask of pad or via objects.
bool GetState_IsTenting_Bottom();
void SetState_IsTenting_Bottom(bool argValue);
Type: bool · Access: read/write
IsTenting_Top
This property determines whether the solder mask of pad and via objects are tented or not on the top layer. A tenting closes an opening in the mask of pad or via objects.
bool GetState_IsTenting_Top();
void SetState_IsTenting_Top(bool argValue);
Type: bool · Access: read/write
IsTestPoint_Bottom
No description yet.
bool GetState_IsTestPoint_Bottom();
void SetState_IsTestPoint_Bottom(bool argValue);
Type: bool · Access: read/write
Examples: Extension_PlacePad
IsTestPoint_Top
No description yet.
bool GetState_IsTestPoint_Top();
void SetState_IsTestPoint_Top(bool argValue);
Type: bool · Access: read/write
Layer
The layer the object is on, as a TV6_Layer.
TV6_Layer GetState_Layer();
void SetState_Layer(TV6_Layer argLayer);
Type: TV6_Layer · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
A layer that TV6_Layer cannot represent reads as the nearest value; mid layers above 30 as TV6_Layer.eV6_MidLayer30, internal planes above 16 as TV6_Layer.eV6_InternalPlane16, mechanical layers above 16 as TV6_Layer.eV6_Mechanical16, and other layers as TV6_Layer.eV6_NoLayer. V7Layer gives the exact layer.
Examples: Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent, Extension_PlacePad
MiscFlag1
This property determines the boolean value from the MiscFlag1 property and can be used for custom purposes.
bool GetState_MiscFlag1();
void SetState_MiscFlag1(bool argValue);
Type: bool · Access: read/write
MiscFlag2
This property determines the boolean value from the MiscFlag2 property and can be used for custom purposes.
bool GetState_MiscFlag2();
void SetState_MiscFlag2(bool argValue);
Type: bool · Access: read/write
MiscFlag3
This property determines the boolean value from the MiscFlag3 property and can be used for custom purposes.
bool GetState_MiscFlag3();
void SetState_MiscFlag3(bool argValue);
Type: bool · Access: read/write
Moveable
This property determines whether this design object can be moved or not (by the autorouter for example).
bool GetState_Moveable();
void SetState_Moveable(bool argValue);
Type: bool · Access: read/write
Net
The Net property of an object denotes it has an electrical property, meaning it is connected from one node to another.
IPCB_Net GetState_Net();
void SetState_Net(IPCB_Net argValue);
Type: IPCB_Net · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
ObjectID
No description yet.
TObjectId GetState_ObjectID();
Type: TObjectId · Access: read-only
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
ObjectIDString
This ObjectIDString property returns the Object Id string. For example eTrackObject type will yield a Track string.
string GetState_ObjectIDString();
Type: string · Access: read-only
PadCacheRobotFlag
Not used; the property reads false, and setting it has no effect.
bool GetState_PadCacheRobotFlag();
void SetState_PadCacheRobotFlag(bool argValue);
Type: bool · Access: read/write
PasteMaskExpansion
The paste mask expansion of the object, in internal units (10,000 per mil).
int GetState_PasteMaskExpansion();
Type: int · Access: read-only
The value comes from the paste mask expansion rule that applies to the object, or is the object's manual expansion when it has one; it is 0 when the object has no paste mask.
Polygon
This method retrieves the IPCB_Polygon interface that the design object primitive is associated with. For example, a polygon may contain arcs and tracks, and when you only have the arc, you can retrieve the polygon the arc is associated with.
IPCB_Polygon GetState_Polygon();
void SetState_Polygon(IPCB_Polygon argValue);
Type: IPCB_Polygon · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
PolygonOutline
This method determines whether the design object primitive is part of the polygon outline or not.
bool GetState_PolygonOutline();
void SetState_PolygonOutline(bool argValue);
Type: bool · Access: read/write
PowerPlaneClearance
The power plane clearance of the object, in internal units (10,000 per mil).
int GetState_PowerPlaneClearance();
Type: int · Access: read-only
The value comes from the power plane clearance rule that applies to the object.
PowerPlaneConnectStyle
The style of the object's connection to power planes.
TPlaneConnectStyle GetState_PowerPlaneConnectStyle();
Type: TPlaneConnectStyle · Access: read-only
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
The value comes from the power plane connect style rule that applies to the object; TPlaneConnectStyle.eNoConnect when no rule applies.
See also: TPlaneConnectStyle
PowerPlaneReliefExpansion
The relief expansion of the object's power plane connection, in internal units (10,000 per mil).
int GetState_PowerPlaneReliefExpansion();
Type: int · Access: read-only
The value comes from the power plane connect style rule that applies to the object.
Preview
No description yet.
void SetState_Preview(bool argEnable, uint argColor, float argOpacity, int argz, int argHeight, float argsx, float argsy, float argSZ);
Type: float · Access: write-only · Index: argEnable (bool), argColor (uint), argOpacity (float), argz (int), argHeight (int), argsx (float), argsy (float)
ReliefAirGap
The ReliefAirGap property retrieves the relief air gap value for this pad/via object, in internal units (10,000 per mil).
int GetState_ReliefAirGap();
Type: int · Access: read-only
The value comes from the power plane connect style rule that applies to the object.
ReliefConductorWidth
The relief conductor width of the pad or via, in internal units (10,000 per mil).
int GetState_ReliefConductorWidth();
Type: int · Access: read-only
The value comes from the power plane connect style rule that applies to the object.
ReliefEntries
This property retrieves the number of relief entries for a pad/via object.
int GetState_ReliefEntries();
Type: int · Access: read-only
The value comes from the power plane connect style rule that applies to the object.
Selected
This property determines whether this object is selected or not on the PCB document.
bool GetState_Selected();
void SetState_Selected(bool argB);
Type: bool · Access: read/write
Examples: Extension_PlaceAndMovePcbComponent, Extension_PlacePad
SolderMaskExpansion
The solder mask expansion of the object, in internal units (10,000 per mil).
int GetState_SolderMaskExpansion();
Type: int · Access: read-only
The value comes from the solder mask expansion rule that applies to the object (its top side expansion), or is the object's manual expansion when it has one; it is 0 when the object has no solder mask.
A Solder Mask expansion property for a pad object is currently relevant just for pads on top and bottom copper layers.
TearDrop
This property determines whether the PCB object (an arc or track object) is used for as a tear drop.
bool GetState_TearDrop();
void SetState_TearDrop(bool argValue);
Type: bool · Access: read/write
UnionIndex
The property denotes the union index. Unions are sets of components that will be manipulated as a block for the PCB placement. Components in a union maintain their relative positions within the union as they are moved for example.
int GetState_UnionIndex();
void SetState_UnionIndex(int argValue);
Type: int · Access: read/write
See also: IPCB_Component
UniqueId
No description yet.
string GetState_UniqueId();
Type: string · Access: read-only
UniqueID
No description yet.
void SetState_UniqueID(string argValue);
Type: string · Access: write-only
Used
No description yet.
bool GetState_Used();
void SetState_Used(bool argValue);
Type: bool · Access: read/write
UserRouted
No description yet.
bool GetState_UserRouted();
void SetState_UserRouted(bool argValue);
Type: bool · Access: read/write
V7Layer
The layer the object is on.
V7_LayerBase GetState_V7Layer();
void SetState_V7Layer(V7_LayerBase argL);
Type: V7_LayerBase · Access: read/write
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
Identifies every layer, including the layers that Layer cannot represent.
ViewableObjectID
The read only property determines the ViewableObjectID of the design object. The TViewableObjectID type is a more descriptive ID of a design object than the TObjectID type.
TViewableObjectID GetState_ViewableObjectID();
Type: TViewableObjectID · Access: read-only
The accessors are extension methods of IPCB_PrimitiveHelper (using PCB;).
For example any type of dimension object is a eDimension type according to the TObjectID but could be one of the eViewableObject_LinearDimension...eViewableObject_RadialDiameterDimension value.
This TViewableObjectID type is mainly used by the Inspector and List views in Altium Designer and is an extension of TObjectID type.
See also: TViewableObjectID, TObjectId
Methods
| Method | Returns | Description |
|---|---|---|
| BeginModify | void | Starts a change of the object; saves the object's state and tells the board that the object is about to change. |
| BoundingRectangle | CoordRect | This method returns the coordinates of the bounding rectangle that encapsulates the design object on a PCB document. |
| BoundingRectangleChildren | CoordRect | |
| BoundingRectangleForPainting | CoordRect | The bounding rectangle of a design object for painting is potentially the largest of all bounding rectangles because for example a component can have comment and designator objects as well. |
| BoundingRectangleForSelection | CoordRect | The bounding rectangle of a design object used for selection is a bit bigger than the bounding rectangle of a design object itself. |
| CancelModify | void | Ends a change started with BeginModify and restores the object's state that BeginModify saved. |
| EndModify | void | Ends a change started with BeginModify and tells the board that the object has changed. |
| Export_ToParameters | void | |
| FlipXY | void | This method flips the object about the axis depending on Axis and MirrOp parameters. |
| GraphicallyInvalidate | void | Redraws the object in the board's view. |
| IsFreePrimitive | bool | This method determines whether the object is a free primitive (not connected to a net) or just a standalone object. |
| IsHidden | bool | Returns whether this object is hidden from view. |
| IsSaveable | bool | This method determines whether this particular object can be saved in a specified file format version according to the TAdvPCBFileFormatVersion type. |
| MoveByXY | void | Moves the design object by an offset in horizontal and vertical directions. |
| MoveToXY | void | Moves the design object to a new location. |
| Replicate | IPCB_Primitive | Returns a copy of the object. |
| RequiredParamterSpace | int | |
| RotateBy | void | Rotates the object by an angle about its reference point. |
| SwapLayerPairs | void | This method swaps the current layer pair that the PCB design object (vias and pads only) has. |
BeginModify
Starts a change of the object; saves the object's state and tells the board that the object is about to change.
void BeginModify();
Returns: nothing (void)
End the change with EndModify, or with CancelModify to restore the saved state. When the object is on a board, the board's undo history is one of the receivers of the notification.
Examples: Extension_PCBUndoRedo
BoundingRectangle
This method returns the coordinates of the bounding rectangle that encapsulates the design object on a PCB document. There are other two bounding rectangle methods.
CoordRect BoundingRectangle();
Returns: CoordRect
Extension method of IPCB_PrimitiveHelper (using PCB;).
BoundingRectangleChildren
No description yet.
CoordRect BoundingRectangleChildren();
Returns: CoordRect
Extension method of IPCB_PrimitiveHelper (using PCB;).
BoundingRectangleForPainting
The bounding rectangle of a design object for painting is potentially the largest of all bounding rectangles because for example a component can have comment and designator objects as well.
CoordRect BoundingRectangleForPainting();
Returns: CoordRect
Extension method of IPCB_PrimitiveHelper (using PCB;).
BoundingRectangleForSelection
The bounding rectangle of a design object used for selection is a bit bigger than the bounding rectangle of a design object itself.
CoordRect BoundingRectangleForSelection();
Returns: CoordRect
Extension method of IPCB_PrimitiveHelper (using PCB;).
CancelModify
Ends a change started with BeginModify and restores the object's state that BeginModify saved.
void CancelModify();
Returns: nothing (void)
EndModify
Ends a change started with BeginModify and tells the board that the object has changed.
void EndModify();
Returns: nothing (void)
Also updates the board's connectivity for the object. When the object has no board, no notification is sent.
Examples: Extension_PCBUndoRedo
Export_ToParameters
No description yet.
void Export_ToParameters(ref string argParams);
| Parameter | Type | Passing |
|---|---|---|
argParams | string | ref |
Returns: nothing (void)
FlipXY
This method flips the object about the axis depending on Axis and MirrOp parameters.
void FlipXY(int argxis, TMirrorOperation argMirrOp);
void FlipXY(int argxis, int argMirrOp);
| Parameter | Type | Passing |
|---|---|---|
argxis | int | value |
argMirrOp | TMirrorOperation | value |
Returns: nothing (void)
The first overload is an extension method of IPCB_PrimitiveHelper (using PCB;) with typed parameters; the second is declared by the interface.
See also: TMirrorOperation
GraphicallyInvalidate
Redraws the object in the board's view.
void GraphicallyInvalidate();
Returns: nothing (void)
Does nothing for the board itself or for an object that has no board.
Examples: Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent, Extension_PlacePad
IsFreePrimitive
This method determines whether the object is a free primitive (not connected to a net) or just a standalone object.
bool IsFreePrimitive();
Returns: bool
IsHidden
Returns whether this object is hidden from view.
bool IsHidden();
Returns: bool
See also: IPCB_Text
IsSaveable
This method determines whether this particular object can be saved in a specified file format version according to the TAdvPCBFileFormatVersion type.
bool IsSaveable(TAdvPCBFileFormatVersion argVer);
bool IsSaveable(int argVer);
| Parameter | Type | Passing |
|---|---|---|
argVer | TAdvPCBFileFormatVersion | value |
Returns: bool
The first overload is an extension method of IPCB_PrimitiveHelper (using PCB;) with typed parameters; the second is declared by the interface.
See also: TAdvPCBFileFormatVersion
MoveByXY
Moves the design object by an offset in horizontal and vertical directions.
void MoveByXY(int argX, int argY);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argX | int | value | The horizontal offset, in internal units (10,000 per mil). |
argY | int | value | The vertical offset, in internal units (10,000 per mil). |
Returns: nothing (void)
Example: Move the first selected object on the current board by a distance in a direction.
using PCB;
IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null || board.GetState_SelectecObjectCount() == 0)
return;
IPCB_Primitive pcbObject = board.GetState_SelectecObject(0);
// Sample values: the distance and the direction (in radians) of the move.
int distanceStep = EDP.Utils.MilsToCoord(100);
double angleStep = Math.PI / 4;
//Move the object by a specified offset
int xStep = (int)(distanceStep * Math.Cos(angleStep));
int yStep = (int)(distanceStep * Math.Sin(angleStep));
pcbObject.MoveByXY(xStep, yStep);
MoveToXY
Moves the design object to a new location.
void MoveToXY(int argX, int argY);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argX | int | value | The X coordinate of the new location, in internal units (10,000 per mil). |
argY | int | value | The Y coordinate of the new location, in internal units (10,000 per mil). |
Returns: nothing (void)
Replicate
Returns a copy of the object.
IPCB_Primitive Replicate();
Returns: IPCB_Primitive
Extension method of IPCB_PrimitiveHelper (using PCB;).
RequiredParamterSpace
No description yet.
int RequiredParamterSpace();
Returns: int
RotateBy
Rotates the object by an angle about its reference point.
void RotateBy(double argngle);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argngle | double | value | The angle, in degrees. |
Returns: nothing (void)
SwapLayerPairs
This method swaps the current layer pair that the PCB design object (vias and pads only) has.
void SwapLayerPairs();
Returns: nothing (void)
Returned by
IPCB_AbstractIterator.FirstPCBObject, IPCB_AbstractIterator.NextPCBObject, IPCB_AccordinGraphicIterator.First, IPCB_AccordinGraphicIterator.Next, IPCB_BackDrilling.SourceObject, IPCB_Board.GetLastClickedObject, IPCB_Board.GetObjectAtCursor, IPCB_Board.GetObjectAtXYAskUserIfAmbiguous, IPCB_Board.SelectecObject, IPCB_Component.Getstate_PadByName, IPCB_Coordinate.Text, IPCB_Coordinate.Track1, IPCB_Coordinate.Track2, IPCB_CustomPadShape.CustomShape, IPCB_CustomPadShape.ExtractedPrimitiveOnLayer, IPCB_DocumentPainterView.FocusedPrimitive, IPCB_DrillTableGraphicIterator.First, IPCB_DrillTableGraphicIterator.Next, IPCB_Group.GetPrimitiveAt, IPCB_Group.ReplicateWithChildren, IPCB_GroupComparisionResult.GetPrimitiveForLayer, IPCB_Net.Getstate_PadByName, IPCB_Net.Getstate_PadByPinDescription, IPCB_OriginalDimension.Track1, IPCB_OriginalDimension.Track2, IPCB_OriginalDimension.Track3, IPCB_OriginalDimension.Track4, IPCB_OriginalDimension.Track5, IPCB_OriginalDimension.Track6, IPCB_OriginalDimension.Track7, IPCB_OriginalDimension.Track8, IPCB_PinPair.CastToPrimitive, IPCB_PinPair.GetPrimitives, IPCB_PrimitiveList.Get, IPCB_RealPlacementGuide.SourceObject, IPCB_ServerInterface.PCBObjectFactory, IPCB_SharedUnion.OwnerPrimitive, IPCB_Violation.Primitive1, IPCB_Violation.Primitive2, IPCB_Violation.Rule, and 1 more.
Accepted by
IPCB_Board.AddObjectToHighlightObjectList, IPCB_Board.AddPCBObject, IPCB_Board.DispatchMessage, IPCB_Board.FindDominantRuleForObject, IPCB_Board.FindDominantRuleForObjectPair, IPCB_Board.FindLinkedBoardLibrary, IPCB_Board.FindLinkedBoardTemplate, IPCB_Board.HidePCBObject, IPCB_Board.InvertPCBObject, IPCB_Board.LinkToTemplate, IPCB_Board.PrimPrimDistance, IPCB_Board.RemovePCBObject, IPCB_Board.SelectedObjects_Add, IPCB_Board.ShowPCBObject, IPCB_Board.UnlinkFromTemplate, IPCB_Board.ViewManager_GraphicallyInvalidatePrimitive, IPCB_BoardEx.Drillmanager_GetDrillSymbolIndex, IPCB_BoardEx.GetSignalDelayForPrim, IPCB_BoardEx.GetSignalDelayPerMeter, IPCB_BoardEx2.GetBoardRegionForPrimitive, IPCB_BoardEx2.GetLayerStackForPrimitive, IPCB_BoardOutline.HitPrimitive_1, IPCB_BoardOutlineClearanceConstraint.GetObstacleTracks, IPCB_ClearanceConstraint.Clearance, IPCB_ClearanceConstraint.PrimitivesViolate, IPCB_ConnectivityGraph.FindShortestPath, IPCB_ContourMaker.MakeContour, IPCB_ContourMaker2.MakeContour_10, IPCB_Dimension.References_IndexOf, IPCB_DocumentPainterListener.OnBeginDrag, IPCB_DocumentPainterListener.OnClick, IPCB_DocumentPainterListener.OnDragging, IPCB_DocumentPainterListener.OnEndDrag, IPCB_DocumentPainterView.AddOrUpdatePrim, IPCB_DocumentPainterView.FocusPrimitive, IPCB_DocumentPainterView.SelectPrimitive, IPCB_GeometryMaker.BuildGeometry, IPCB_GridManager.AddHorizontalGuide, IPCB_GridManager.AddMinus45DegreeGuide, IPCB_GridManager.AddPlus45DegreeGuide, and 56 more.
Examples
Used in the SDK examples: Extension_PCBUndoRedo, Extension_PcbLibToImage.