原理图API常量

Nexus message

This documentation page references Altium NEXUS/NEXUS Client (part of the deployed NEXUS solution), which has been discontinued. All your PCB design, data management and collaboration needs can now be delivered by Altium Designer and a connected Altium 365 Workspace. Check out the FAQs page for more information.

Parent page: Technical Reference - Schematic API

Please note that this documentation was last updated for an older version of Altium NEXUS. While many of the principles and approaches will remain the same, be aware that interfaces, objects, methods, properties, and the like will have changed since then, and will not reflect the entirety of those found in later versions of the software.

Schematic API: Constants Reference

The Schematic API Constants reference includes the following content:

Internal Unit constants
MM to Internal Units Values
Other Constants
Power Object constants
Parameter Set constants
Title Block constants
Differential Pair constants

 

Internal Unit constants

cUnits : Array [TUnit] Of TDynamicString   = ('mil', 'mm', 'in', 'cm', '', 'm', 'AutoImperial', 'AutoMetric');
cUnitSystems : Array[TUnitSystem] Of TUnitSet = ([eMil, eIN, eDXP, eAutoImperial], [eMM,  eCM, eM, eAutoMetric]);
cAutoUnits = [eAutoImperial, eAutoMetric];
cDefaultUnit             : Array[TUnitSystem] Of TUnit = (eDXP, eMM);
cDefaultGridSettingsUnit : Array[TUnitSystem] Of TUnit = (eMil, eMM);
 
//1 DXP 2004 SP1 Internal Unit =
// 100000 DXP 2004 SP2 Internal Unit (= 10 mils)
cBaseUnit           = 100000;
 
//1 mil = 10000 DXP 2004 SP2 internal units
cInternalPrecision  = 10000;
 
//Size of workspace in DXP 2004 SP1 base logical unit
cMaxWorkspace       = 6500;
 
//Size of workspace in DXP 2004 SP1 base logical unit
cMinWorkspace       = 10;
 
//Size of workspace in the new logical unit - max
cMaxWorkspaceSize   = cMaxWorkspace*cBaseUnit;
 
//Size of workspace in the new logical unit - min
cMinWorkspaceSize   = cMinWorkspace*cBaseUnit;
CMaxTextParamLength = 32000;
 
cSchInternalTolerance_Metric = 2*cInternalPrecision;
 
//0 for imperial and 0.004318mm for metric
cSchInternalTolerance : Array[TUnitSystem] Of TCoord = (0, cSchInternalTolerance_Metric);
 
cSymbolLineWidthArray : Array [TSize] of  Integer  = (0,1*cBaseUnit,3*cBaseUnit,5*cBaseUnit);
 
cDefaultCustomSizeX_Sheet    : Array[TUnitSystem] Of Integer = (1500*cBaseUnit,   30*c10_0MM);
cDefaultCustomSizeY_Sheet    : Array[TUnitSystem] Of Integer = (950 *cBaseUnit,   20*c10_0MM);
cDefaultCustomSizeX_Library  : Array[TUnitSystem] Of Integer = (2000*cBaseUnit,   40*c10_0MM);
cDefaultCustomSizeY_Library  : Array[TUnitSystem] Of Integer = (2000*cBaseUnit,   40*c10_0MM);
cDefaultCustomMarginWidth    : Array[TUnitSystem] Of Integer = (20  *cBaseUnit,      c5_0MM );
 
cPolylineCutterBoxHeight      =  3 *cBaseUnit;
cDefaultSheetFileNamePosition       : Array[TUnitSystem] Of Integer = (10 *cBaseUnit, c2_5MM);
cBusEntryLength                     : Array[TUnitSystem] Of Integer = (10 *cBaseUnit, c2_0MM);
cDefaultPortWidth                   : Array[TUnitSystem] Of Integer = (50 *cBaseUnit, c10_0MM);
cDefaultSheetSymbolXSize            : Array[TUnitSystem] Of Integer = (80 *cBaseUnit, 5*c7_5MM);
cDefaultSheetSymbolYSize            : Array[TUnitSystem] Of Integer = (50 *cBaseUnit, 5*c5_0MM);
cDefaultSheetEntryGridSize          : Array[TUnitSystem] Of Integer = (10 *cBaseUnit, c2_5MM);
cDefaultPolylineCutterFixedLength   : Array[TUnitSystem] Of Integer = (10 *cBaseUnit, c2_5MM);
cDefaultAutoPanJumpDistance         : Array[TUnitSystem] Of Integer = (30 *cBaseUnit, c7_5MM);
cDefaultAutoPanShiftJumpDistance    : Array[TUnitSystem] Of Integer = (100*cBaseUnit, c25_0MM);
cDefaultPinLength                   : Array[TUnitSystem] Of Integer = (30 *cBaseUnit, c0_50MM);
cDefaultCircleRadius                : Array[TUnitSystem] Of Integer = (100*cBaseUnit, c7_5MM);
cDefaultArcRadius                   : Array[TUnitSystem] Of Integer = (10 *cBaseUnit, c5_0MM);
cDefaultStartAngle                  = 30;
cDefaultEndAngle                    = 330;
cDefaultEllipseRadius               : Array[TUnitSystem] Of Integer = (20 * cBaseUnit, c5_0MM);
cDefaultEllipseSecondaryRadius      : Array[TUnitSystem] Of Integer = (10 * cBaseUnit, c2_5MM);
cDefaultEllipticalArcSecondaryRadius: Array[TUnitSystem] Of Integer = (10 * cBaseUnit, c2_5MM);
cDefaultRectangleCornerX            : Array[TUnitSystem] Of Integer = (50 * cBaseUnit, c5_0MM);
cDefaultRectangleCornerY            : Array[TUnitSystem] Of Integer = (50 * cBaseUnit, c5_0MM);
cDefaultIEESymbolScale              : Array[TUnitSystem] Of Integer = (10 * cBaseUnit, c2_5MM);
cDefaultRoundRectCornerXRadius      : Array[TUnitSystem] Of Integer = (20 * cBaseUnit, c0_50MM);
cDefaultRoundRectCornerYRadius      : Array[TUnitSystem] Of Integer = (20 * cBaseUnit, c0_50MM);
cDefaultLabelXSize                  : Array[TUnitSystem] Of Integer = (40 * cBaseUnit, c0_25MM);
cDefaultLabelYSize                  : Array[TUnitSystem] Of Integer = (10 * cBaseUnit, c0_50MM);
cIEESymbolScale_Min                 = 1   * cBaseUnit;
cIEESymbolScale_Max                 = 200 * cBaseUnit;
cIEESymbolScale_Step                = 1  * cBaseUnit;
 
cDuplicateOffsetX                   : Array[TUnitSystem] Of Integer = ( 20 * cBaseUnit,  c5_0MM);
cDuplicateOffsetY                   : Array[TUnitSystem] Of Integer = (-20 * cBaseUnit, -c5_0MM);
 
cJumpLocationZoomRectWidth          = 200 * cBaseUnit;
cJumpLocationZoomRectHeight         = 200 * cBaseUnit;
cSheetSymbolBoundingRectInflate     = 20  * cBaseUnit;
cPinFullBoundingRectInflate         = 5   * cBaseUnit;
cPolylineBoundingRectInflate        = 10  * cBaseUnit;
cFindReplaceRectInflate             = 50  * cBaseUnit;
cPinIEEESymbolRectInflateBy         = 6   * cBaseUnit;
cPortWidthInflate                   = 10  * cBaseUnit;
cMinPortWidth                       = 30  * cBaseUnit;
cMinSheetSymbolBorderGap            : Array[TUnitSystem] Of Integer = (10 * cBaseUnit, c2_5MM);
 

MM to Internal Units Values

Each Millimetre constant value is expressed in internal units (rounded to nearest integer value).
c0_25MM = 98425;
c0_50MM = 196850;
c0_75MM = 295275;
c1_00MM = 393701;
c1_5MM  = 590551;
c2_0MM  = 787402;
c2_5MM  = 984252;
c3_0MM  = 1181102;
c3_5MM  = 1377953;
c4_0MM  = 1574803;
c4_5MM  = 1771654;
c5_0MM  = 1968504;
c5_5MM  = 2165354;
c6_0MM  = 2362205;
c6_5MM  = 2559055;
c7_0MM  = 2755906;
c7_5MM  = 2952756;
c8_0MM  = 3149606;
c8_5MM  = 3346457;
c9_0MM  = 3543307;
c9_5MM  = 3740157;
c10_0MM = 3937008;
c15_0MM = 5905512;
c20_0MM = 7874016;
c25_0MM = 9842520;
c30_0MM = 11811024;
c35_0MM = 13779528;
c40_0MM = 15748031;
c45_0MM = 17716535;
c50_0MM = 19685039;
c55_0MM = 21653543;
c60_0MM = 23622047;
c65_0MM = 25590551;
c70_0MM = 27559055;
c75_0MM = 29527559;
c80_0MM = 31496063;
c85_0MM = 33464567;
c90_0MM = 35433071;
c95_0MM = 37401575;
c100_0MM  = 39370078;
c1000_0MM = 393700787;

Other Constants

cMaxShortStringLength

cMaxShortStringLength = 254;

cOldSheetEntryGrid

cOldSheetEntryGrid = 10;

cOldMaxPolygonVertices

cOldMaxPolygonVertices = 50;
cCharacterApproximativeWidth  = 8  * cBaseUnit;
cCharacterApproximativeHeight = 10 * cBaseUnit;
cCharacterWidthTolerance      = 4  * cBaseUnit;
cConnectionDrawingThreshold   = 3;
 
cPinBoundingRectInflate = 2  *cBaseUnit;
cMinWireUnderlineWidth  = 5  *cBaseUnit;
cMinBusUnderlineWidth   = 7  *cBaseUnit;
cCompilationMaskedPopupString = 'Removed by Compilation Mask';

LibPrimitiveSet

LibPrimitiveSet:  TObjectSet = [eRectangle,
                                eLine,
                                eArc,
                                eBus,
                                eBusEntry,
                                eEllipticalArc,
                                eRoundRectangle,
                                eImage,
                                ePie,
                                eEllipse,
                                ePolygon,
                                ePolyline,
                                ePort,
                                eBezier,
                                eLabel,
                                eNetlabel,
                                eTextFrame,
                                eSymbol,
                                ePin,
                                eParameterSet
                                eWire];
 
cObjectInspectorViewname    = 'SchObjectInspector';
cLibObjectInspectorViewname = 'SchLibObjectInspector';
 
cGroundTypeSet = [ePowerGndPower, ePowerGndSignal, ePowerGndEarth];
 
CLineShapeArrowRatio = 2;
CLineShapeSizeCoefs : Array[TSize] Of Integer = (1, 2, 3, 4);
 
cNoUnionIndex = 0;
 
cStringIncrementStyleStrings : Array[TStringIncrementStyle] Of String = ('None','Horizontal First', 'Vertical First');

cBooleanEditorAttributes

cBooleanEditorAttributes =
    [eObjectAttribute_IsHidden,
     eObjectAttribute_Locked,
     eObjectAttribute_Accessible,
     eObjectAttribute_Solid,
     eObjectAttribute_ShowName,
     eObjectAttribute_IsMirrored,
     eObjectAttribute_DesignatorLocked,
     eObjectAttribute_PartIdLocked,
     eObjectAttribute_PinsMoveable,
     eObjectAttribute_ImageKeepAspect,
     eObjectAttribute_ImageEmbed,
     eObjectAttribute_ParameterAllowLibrarySynchronize,
     eObjectAttribute_ParameterAllowDatabaseSynchronize,
     eObjectAttribute_TextAutoPosition,
     eObjectAttribute_PinShowDesignator,
     eObjectAttribute_ShowHiddenFields,
     eObjectAttribute_ShowHiddenPins,
     eObjectAttribute_ShowDesignator,
     eObjectAttribute_TextFrameWordWrap,
     eObjectAttribute_TextFrameShowBorder,
     eObjectAttribute_TextFrameClipToRect,
     eObjectAttribute_PowerObjectShowNetName];

cStringEditorAttributes

cStringEditorAttributes =
    [eObjectAttribute_LocationX,
     eObjectAttribute_LocationY,
     eObjectAttribute_CornerLocationX,
     eObjectAttribute_CornerLocationY,
     eObjectAttribute_Width,
     eObjectAttribute_Radius,
     eObjectAttribute_StartAngle,
     eObjectAttribute_EndAngle,
     eObjectAttribute_SecondaryRadius,
     eObjectAttribute_StringText,
     eObjectAttribute_Name,
     eObjectAttribute_Description,
     eObjectAttribute_ParameterValue,
     eObjectAttribute_ParameterName,
     eObjectAttribute_PinWidth,
     eObjectAttribute_PinDefaultValue,
     eObjectAttribute_PinDesignator,
     eObjectAttribute_PinHiddenNetName,
     eObjectAttribute_PinLength,
     eObjectAttribute_RoundRectangleCornerRadiusX,
     eObjectAttribute_RoundRectangleCornerRadiusY,
     eObjectAttribute_SchComponentLibReference,
     eObjectAttribute_SchComponentDesignator,
     eObjectAttribute_SheetEntryDistanceFromTop,
     eObjectAttribute_SymbolScaleFactor,
     eObjectAttribute_TaskHolderInstanceName,
     eObjectAttribute_SheetName,
     eObjectAttribute_OwnerName,
     eObjectAttribute_SchComponentComment,
     eObjectAttribute_SchComponentLibraryName,
     eObjectAttribute_SchComponentFootprint,
     eObjectAttribute_SelectedVertex_X,
     eObjectAttribute_SelectedVertex_Y,
     eObjectAttribute_SelectedVertex2_X,
     eObjectAttribute_SelectedVertex2_Y];

cComboBoxEditorAttributes

cComboBoxEditorAttributes =
    [eObjectAttribute_OwnerPartId,
     eObjectAttribute_OwnerPartDisplayMode,
     eObjectAttribute_LineStyle,
     eObjectAttribute_StartLineShape,
     eObjectAttribute_EndLineShape,
     eObjectAttribute_LineShapeSize,
     eObjectAttribute_Orientation,
     eObjectAttribute_Alignment,
     eObjectAttribute_BorderWidth,
     eObjectAttribute_LineWidth,
     eObjectAttribute_JunctionSize,
     eObjectAttribute_ParameterType,
     eObjectAttribute_ParameterReadOnlyState,
     eObjectAttribute_PinSwapId_Pin,
     eObjectAttribute_PinSwapId_Part,
     eObjectAttribute_PinSwapId_PartPin,
     eObjectAttribute_PinFormalType,
     eObjectAttribute_PinElectrical,
     eObjectAttribute_PinIeeeSymbolInner,
     eObjectAttribute_PinIeeeSymbolOuter,
     eObjectAttribute_PinIeeeSymbolInnerEdge,
     eObjectAttribute_PinIeeeSymbolOuterEdge,
     eObjectAttribute_SheetEntrySide,
     eObjectAttribute_PortArrowStyle,
     eObjectAttribute_PortIOType,
     eObjectAttribute_PowerObjectStyle,
     eObjectAttribute_CrossSheetConnectorStyle,
     eObjectAttribute_SchComponentDisplayMode,
     eObjectAttribute_SchComponentPartId,
     eObjectAttribute_SchComponentKind,
     eObjectAttribute_IeeeSymbol];

cColorEditorAttributes

cColorEditorAttributes =
    [eObjectAttribute_Color,
     eObjectAttribute_TextColor,
     eObjectAttribute_AreaColor];

cContextHelpStringsByObjectId

cContextHelpStringsByObjectId : Array[TObjectId] Of TDynamicString =
( 'FirstObjectID',
'ClipBoardContainer',
'Note',
'Probe',
'Rectangle',
'Line',
'ConnectionLine',
'BusEntry',
'Arc',
'EllipticalArc',
'RoundRectangle',
'Image',
'Pie',
'TextFrame',
'Ellipse',
'Junction',
'Polygon',
'Polyline',
'Wire',
'Bus',
'Bezier',
'Label',
'NetLabel',
'Designator',
'SchComponent',
'Parameter',
'ParameterSet',
'ParameterList',
'SheetName',
'SheetFileName',
'Sheet',
'SchLib',
'Symbol',
'NoERC',
'ErrorMarker',
'Pin',
'Port',
'PowerObject',
'SheetEntry',
'SheetSymbol',
'Template',
'TaskHolder',
'MapDefiner',
'ImplementationMap',
'Implementation',
'ImplementationsList',
'CrossSheetConnector',
'CompileMask',
'OpenBusComponent',
'OpenBusLink',
'OpenBusDesignator',
'HarnessConnector',
'HarnessEntry',
'HarnessConnectorType',
'SignalHarness',
'OpenBusPort',
'LastObjectId'
);

Power Object constants

cPowerObjectLineWidth  = 1 * cBaseUnit;
cPowerGndPowerXOffset1 = 0 * cBaseUnit;
cPowerGndPowerXOffset2 = 3 * cBaseUnit;
cPowerGndPowerXOffset3 = 6 * cBaseUnit;
cPowerGndPowerXOffset4 = 9 * cBaseUnit;
cPowerGndPowerYOffset1 = 10 * cBaseUnit;
cPowerGndPowerYOffset2 = 7  * cBaseUnit;
cPowerGndPowerYOffset3 = 4  * cBaseUnit;
cPowerGndPowerYOffset4 = 1  * cBaseUnit;
cPowerNameXOffset1     = 2  * cBaseUnit;

Parameter Set constants

cParameterSetLineWidth          = 1   *cBaseUnit;
cParameterSetLineLength         = 6   *cBaseUnit;
cParameterSetCircleRadius       = 6   *cBaseUnit;
cParameterSetCircleCenterOffset = 12  *cBaseUnit;
cParameterSetIOffsetX           = 12  *cBaseUnit;
cParameterSetIOffsetY           = 5   *cBaseUnit;
cParameterSetTextOffetX         = 20  *cBaseUnit;
cParameterSetParamDefaultLength = 5   *cBaseUnit;
cParameterSetParam000XOffset    = 32  *cBaseUnit;
cParameterSetParam090XOffset    = 4   *cBaseUnit;
cParameterSetParam090YOffset    = 24  *cBaseUnit;
cParameterSetParam180XOffset    = 12   *cBaseUnit
cParameterSetParam270XOffset    = 10   *cBaseUnit
cParameterSetParam270YOffset    = 22  *cBaseUnit;
cParameterSetParamYOffset       = 2   *cBaseUnit;
cParameterSetParamDeltaYOffset1 = 12  *cBaseUnit;
 

Title Block constants

cTitleBlockWidth               = 350 *cBaseUnit;
cTitleBlockWidth1              = 100 *cBaseUnit;
cTitleBlockWidth2              = 150 *cBaseUnit;
cTitleBlockWidth3              = 300 *cBaseUnit;
cTitleBlockHeight              = 80  *cBaseUnit;
cTitleBlockHeight1             = 50  *cBaseUnit;
cTitleBlockHeight2             = 20  *cBaseUnit;
cTitleBlockHeight3             = 10  *cBaseUnit;
cTitleBlockTextXPos_Title      = 345 *cBaseUnit;
cTitleBlockTextXPos_Number     = 295 *cBaseUnit;
cTitleBlockTextXPos_Revision   = 95  *cBaseUnit;
cTitleBlockTextXPos_Size       = 345 *cBaseUnit;
cTitleBlockTextXPos_SheetStyle = 340 *cBaseUnit;
cTitleBlockTextYPos_SheetStyle = 35  *cBaseUnit;
cTitleBlockTextXPos_Date1      = 345 *cBaseUnit;
cTitleBlockTextXPos_Date2      = 300 *cBaseUnit;
cTitleBlockTextXPos_SheetNbr   = 145 *cBaseUnit;
cTitleBlockTextXPos_File1      = 345 *cBaseUnit;
cTitleBlockTextXPos_File2      = 300 *cBaseUnit;
cTitleBlockTextXPos_DrawnBy    = 145 *cBaseUnit;
cTitleBlockTextYPos_TextLine1  = 20  *cBaseUnit;
cTitleBlockTextYPos_TextLine2  = 10  *cBaseUnit;
cAnsiTitleBlock1               = 175 *cBaseUnit;
cAnsiTitleBlock2               = 625 *cBaseUnit;
cAnsiTitleBlock3               = 425 *cBaseUnit;
cAnsiTitleBlock4               = 125 *cBaseUnit;
cAnsiTitleBlock5               = 63  *cBaseUnit;
cAnsiTitleBlock6               = 25  *cBaseUnit;
cAnsiTitleBlock7               = 387 *cBaseUnit;
cAnsiTitleBlock8               = 325 *cBaseUnit;
cAnsiTitleBlock9               = 276 *cBaseUnit;
cAnsiTitleBlock10              = 36  *cBaseUnit;
cAnsiTitleBlock11              = 420 *cBaseUnit;
cAnsiTitleBlock12              = 170 *cBaseUnit;
cAnsiTitleBlock13              = 420 *cBaseUnit;
cAnsiTitleBlock14              = 382 *cBaseUnit;
cAnsiTitleBlock15              = 271 *cBaseUnit;
cAnsiTitleBlock16              = 31  *cBaseUnit;

Differential Pair constants

cDifferentialPairWidth          = 21 * cBaseUnit + cParameterSetLineWidth Div 2;
cDifferentialPairHeight         =  9 * cBaseUnit + cParameterSetLineWidth;
cDifferentialPairShadowSize     = cParameterSetLineWidth;
cDiffPairPosNetNaming           = '_P';
cDiffPairNegNetNaming           = '_N';
cDefaultDiffPairName  : TDynamicString = 'DIFFPAIR';
cDiffPairParam        : TDynamicString = 'DifferentialPair';
cDefaultDiffPair      : TDynamicString = 'DefaultDiffPair'

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.