Skip to main content
View as Markdown

ISch_Document interface

This interface is the immediate ancestor interface for ISch_Sheet and ISch_Lib interfaces.

public interface ISch_Document : ISch_ParametrizedGroup

Namespace: SCH · Assembly: Altium.SDK.Interfaces

Inherits: ISch_BasicContainer → ISch_GraphicalObject → ISch_ParametrizedGroup

Derived: IFSM_Document, ISch_HarnessDocument, ISch_Lib, ISch_Sheet

Remarks​

You can modify or set the document's preference settings.

You can iterate design objects in a Schematic or library document, see ISch_Iterator interface for details.

You can invoke the ChooseLocationInteractively or ChooseRectangleInteractively methods to obtain coordinates from the Schematic sheet or library sheet.

You can create a library from a project that has components

You can check whether objects exist on a particular point on a schematic or library document.

Properties​

PropertyTypeAccessDescription
BorderOnboolget; setThis BorderOn property determines whether the border on around the outside of the current schematic document will be displayed or not.
CustomMarginWidthintget; setThe CustomMarginWidth property sets the margin from the bounds of the schematic sheet inwards.
CustomSheetStylestringget; setThis property represents custom sheet style property which values can be inherited from one of the standard sheet styles and customized further.
CustomXintget; setThis property sets the width of the custom sheet for the document.
CustomXZonesintget; setThis property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders.
CustomYintget; setThis property sets the height of the custom sheet for the document.
CustomYZonesintget; setThis property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders.
DocumentBorderStyleTSheetDocumentBorderStyleget; setThe DocumentBorderStyle property determines the current document/border style for the schematic sheet - whether it is a standard or an ANSI title block.
DocumentNamestringgetThis read only property determines the schematic document name.
HotspotGridOnboolget; set
HotspotGridSizeintget; set
InternalToleranceintget
LoadFormatstringget; set
MinorVersionintget
ReferenceZonesOnboolget; setThis property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders.
SchDocIDintget
SheetMarginWidthintget; setThe SheetMarginWidth property sets the margin from the bounds of the schematic sheet inwards.
SheetSizeXintget; setThe SheetSizeX property defines the width of the sheet.
SheetSizeYintget; setThe SheetSizeY property defines the height of the sheet.
SheetStyleTSheetStyleget; setThe SheetStyle property determines the document standard style.
SheetZonesXintget; set
SheetZonesYintget; set
ShowTemplateGraphicsboolget; setThe template is usually placed on the bottom right of the schematic sheet.
SnapGridOnboolget; setThe snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet.
SnapGridSizeintget; setThe snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet.
SystemFontintget; set
TemplateFileNamestringget; setThe template filename is the filename of the template that is placed usually on the bottom right of the schematic sheet.
TitleBlockOnboolget; set
UnitTUnitget; setThis property determines the system unit used for the schematic project.
UnitSystemTUnitSystemget
UseCustomSheetboolget; setThe property determines whether a custom sheet is used instead of a standard sheet.
VisibleGridOnboolget; setThe electrical grid supports the Schematic Editor's guided wiring feature.
VisibleGridSizeintget; set
WorkspaceOrientationTSheetOrientationget; setThis method sets the orientation of the workspace - either as a portrait or as a landscape format.

BorderOn​

This BorderOn property determines whether the border on around the outside of the current schematic document will be displayed or not.

bool GetState_BorderOn();
void SetState_BorderOn(bool argValue);

Type: bool · Access: read/write

CustomMarginWidth​

The CustomMarginWidth property sets the margin from the bounds of the schematic sheet inwards.

int GetState_CustomMarginWidth();
void SetState_CustomMarginWidth(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

See also: ISch_Document.UseCustomSheet

CustomSheetStyle​

This property represents custom sheet style property which values can be inherited from one of the standard sheet styles and customized further.

string GetState_CustomSheetStyle();
void SetState_CustomSheetStyle(string argValue);

Type: string · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

CustomX​

This property sets the width of the custom sheet for the document.

int GetState_CustomX();
void SetState_CustomX(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

CustomXZones​

This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. The reference zones form a reference grid along the border of your schematic. This reference grid is only for display purposes and does not affect the Snap, Visible or Electrical Grids that are used when placing schematic objects.

int GetState_CustomXZones();
void SetState_CustomXZones(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

CustomY​

This property sets the height of the custom sheet for the document.

int GetState_CustomY();
void SetState_CustomY(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

CustomYZones​

This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. The reference zones form a reference grid along the border of your schematic. This reference grid is only for display purposes and does not affect the Snap, Visible or Electrical Grids that are used when placing schematic objects.

int GetState_CustomYZones();
void SetState_CustomYZones(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to true before you can massage the attributes for the custom style of the schematic sheet.

DocumentBorderStyle​

The DocumentBorderStyle property determines the current document/border style for the schematic sheet - whether it is a standard or an ANSI title block.

TSheetDocumentBorderStyle GetState_DocumentBorderStyle();
void SetState_DocumentBorderStyle(TSheetDocumentBorderStyle argValue);

Type: TSheetDocumentBorderStyle · Access: read/write

The accessors are extension methods of ISch_DocumentHelper (using SCH;).

See also: TSheetDocumentBorderStyle

DocumentName​

This read only property determines the schematic document name.

string GetState_DocumentName();

Type: string · Access: read-only

HotspotGridOn​

No description yet.

bool GetState_HotspotGridOn();
void SetState_HotspotGridOn(bool argValue);

Type: bool · Access: read/write

HotspotGridSize​

No description yet.

int GetState_HotspotGridSize();
void SetState_HotspotGridSize(int argValue);

Type: int · Access: read/write

InternalTolerance​

No description yet.

int GetState_InternalTolerance();

Type: int · Access: read-only

LoadFormat​

No description yet.

string GetState_LoadFormat();
void SetState_LoadFormat(string argValue);

Type: string · Access: read/write

MinorVersion​

No description yet.

int GetState_MinorVersion();

Type: int · Access: read-only

ReferenceZonesOn​

This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. The reference zones form a reference grid along the border of your schematic. This reference grid is only for display purposes and does not affect the Snap, Visible or Electrical Grids that are used when placing schematic objects.

bool GetState_ReferenceZonesOn();
void SetState_ReferenceZonesOn(bool argValue);

Type: bool · Access: read/write

Example: Turn off the reference zones of every schematic sheet in the focused project.

using DXP;
using EDP;
using SCH;

var workspace = DXP.GlobalVars.Client.GetDXPWorkspace() as IWorkspace;
IProject project = workspace?.DM_FocusedProject();
if (project == null)
return;
ISch_ServerInterface schServer = SCH.GlobalVars.SchServer;
ISch_RobotManager robotManager = schServer.GetState_RobotManager();

for (int i = 0; i < project.DM_LogicalDocumentCount(); i++)
{
IDocument document = project.DM_LogicalDocuments(i);
if (document.DM_DocumentKind() != "SCH")
continue;
ISch_Document currentSheet = schServer.GetSchDocumentByPath(document.DM_FullPath());
if (currentSheet != null && currentSheet.GetState_ReferenceZonesOn())
{
robotManager.SendMessage(currentSheet, SCHConstant.BroadCast, SCHConstant.SCHMBeginModify, SCHConstant.NoEventData);
currentSheet.SetState_ReferenceZonesOn(false);
robotManager.SendMessage(currentSheet, SCHConstant.BroadCast, SCHConstant.SCHMEndModify, SCHConstant.NoEventData);
}
}

SchDocID​

No description yet.

int GetState_SchDocID();

Type: int · Access: read-only

SheetMarginWidth​

The SheetMarginWidth property sets the margin from the bounds of the schematic sheet inwards.

int GetState_SheetMarginWidth();
void SetState_SheetMarginWidth(int argValue);

Type: int · Access: read/write

The UseCustomSheet property must be set to false before you can massage the attributes for the schematic sheet.

SheetSizeX​

The SheetSizeX property defines the width of the sheet.

int GetState_SheetSizeX();
void SetState_SheetSizeX(int argValue);

Type: int · Access: read/write

See also: ISch_Document.SheetSizeY

SheetSizeY​

The SheetSizeY property defines the height of the sheet.

int GetState_SheetSizeY();
void SetState_SheetSizeY(int argValue);

Type: int · Access: read/write

SheetStyle​

The SheetStyle property determines the document standard style. One of the document sheet styles are A4, Letter and imperial/metric sized sheets.

TSheetStyle GetState_SheetStyle();
void SetState_SheetStyle(TSheetStyle argValue);

Type: TSheetStyle · Access: read/write

The accessors are extension methods of ISch_DocumentHelper (using SCH;).

See also: TSheetStyle

SheetZonesX​

No description yet.

int GetState_SheetZonesX();
void SetState_SheetZonesX(int argValue);

Type: int · Access: read/write

SheetZonesY​

No description yet.

int GetState_SheetZonesY();
void SetState_SheetZonesY(int argValue);

Type: int · Access: read/write

ShowTemplateGraphics​

The template is usually placed on the bottom right of the schematic sheet. The template files have a DOT extension and are located in the \Templates\ folder of the Altium Designer software installation.

bool GetState_ShowTemplateGraphics();
void SetState_ShowTemplateGraphics(bool argValue);

Type: bool · Access: read/write

The property determines whether the template graphics are displayed or not.

SnapGridOn​

The snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet. This grid should be left on at all times except when specifically placing or moving objects that need to be off grid such as text objects. The visible grid is the grid you see on the grid which acts as a visual grid and typically it is set to be the same as or a multiple of the snap grid.

bool GetState_SnapGridOn();
void SetState_SnapGridOn(bool argValue);

Type: bool · Access: read/write

SnapGridSize​

The snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet. This grid should be left on at all times except when specifically placing or moving objects that need to be off grid such as text objects. The visible grid is the grid you see on the grid which acts as a visual grid and typically it is set to be the same as or a multiple of the snap grid.

int GetState_SnapGridSize();
void SetState_SnapGridSize(int argValue);

Type: int · Access: read/write

SystemFont​

No description yet.

int GetState_SystemFont();
void SetState_SystemFont(int argValue);

Type: int · Access: read/write

TemplateFileName​

The template filename is the filename of the template that is placed usually on the bottom right of the schematic sheet. The template files have a DOT extension and are located in the \Templates\ folder of Altium Designer software installation.

string GetState_TemplateFileName();
void SetState_TemplateFileName(string argValue);

Type: string · Access: read/write

See also: ISch_Document.ShowTemplateGraphics

TitleBlockOn​

No description yet.

bool GetState_TitleBlockOn();
void SetState_TitleBlockOn(bool argValue);

Type: bool · Access: read/write

See also: ISch_Document.DocumentBorderStyle

Unit​

This property determines the system unit used for the schematic project. The available imperial units are Mils, inches, DXP default and Auto imperial as well as available metric units which are mm,cm,metres and autometric.

TUnit GetState_Unit();
void SetState_Unit(TUnit argValue);

Type: TUnit · Access: read/write

The accessors are extension methods of ISch_DocumentHelper (using SCH;).

See also: TUnit

UnitSystem​

No description yet.

TUnitSystem GetState_UnitSystem();

Type: TUnitSystem · Access: read-only

The accessors are extension methods of ISch_DocumentHelper (using SCH;).

UseCustomSheet​

The property determines whether a custom sheet is used instead of a standard sheet. If the UseCustomSheet is true, then the CustomMarginWidth, CustomSheetStyle, CustomX and CustomY properties can be set for this custom sheet property.

bool GetState_UseCustomSheet();
void SetState_UseCustomSheet(bool argValue);

Type: bool · Access: read/write

See also: ISch_Document.CustomX, ISch_Document.CustomY, ISch_Document.CustomSheetStyle, ISch_Document.CustomMarginWidth

VisibleGridOn​

The electrical grid supports the Schematic Editor's guided wiring feature. When you are moving an electrical object in the workspace, and when it falls within the electrical grid range of another electrical object that you could connect to, the object you are moving will snap to the fixed object and a hot spot or highlight dot will appear. This dot guides you as to where a valid connection can be made. The electrical grid (hot spot) should be set slightly lower than the current snap grid or else it becomes difficult to position electrical objects one snap grid apart.

bool GetState_VisibleGridOn();
void SetState_VisibleGridOn(bool argValue);

Type: bool · Access: read/write

VisibleGridSize​

No description yet.

int GetState_VisibleGridSize();
void SetState_VisibleGridSize(int argValue);

Type: int · Access: read/write

WorkspaceOrientation​

This method sets the orientation of the workspace - either as a portrait or as a landscape format.

TSheetOrientation GetState_WorkspaceOrientation();
void SetState_WorkspaceOrientation(TSheetOrientation argValue);

Type: TSheetOrientation · Access: read/write

The accessors are extension methods of ISch_DocumentHelper (using SCH;).

See also: TSheetOrientation

Methods​

MethodReturnsDescription
BoundingRectangle_SelectedCoordRectThe method returns the coordinates of the selected bounding rectangle on the current schematic document.
ChooseLocationInteractivelyboolTo monitor the mouse movement and clicks from your extension, the ISch_Document document interface and its descendant interfaces, ISch_Lib and ISch_Sheet interfaces has several interactive feedback m…
ChooseRectangleInteractivelyboolTo monitor the mouse movement and clicks from your extension, the ISch_Document document interface and its descendant interfaces, ISch_Lib and ISch_Sheet interfaces has several interactive feedback m…
CountContextMenuObjectsintThe method counts the contextual objects based on an object set.
CreateHitTestISch_HitTestThe CreateHitTest method creates an hit test object which is represented by the ISch_HitTest interface with the ATestMode and ALocation parameters.
CreateLibraryFromProjectvoidThis method creates a schematic library based on the components on a schematic project.
GenerateUniqueIDstring
GetPropsRevisionGUIDstring
GetPropsVaultGUIDstring
GetTemplateItemGUIDstring
GetTemplateRevisionGUIDstring
GetTemplateRevisionHRIDstring
GetTemplateVaultGUIDstring
GetTemplateVaultHRIDstring
Graphical_VirtualRectangleCoordRectThe method returns the coordinates of TCoordRect type of the virtual rectangle of the graphical window in Altium Designer.
GridCoordinateClosestint
GridCoordinateUpint
HasServerDocumentbool
IsInEditorViewbool
LockViewUpdatevoidThis method prevents the views of Schematic documents and panels from being refreshed or updated.
Notify_FullUpdatevoid
ObjectReferenceZonestringThe method returns the reference zone string for the design object on the schematic sheet.
PopupMenuHitTestISch_HitTest
RecreateHandlesvoid
RedrawToDCvoidThe DC parameter is a Handle of the canvas (a encapsulation of a device context).
RegisterSchObjectInContainervoidThe RegisterSchObjectInContainer method registers the object of ISch_BasicContainer type (including its descendants) in the parent object itself.
SetPreferencesInfovoid
SetTemplateInfovoid
UnLockViewUpdatevoidThis method allows the views of Schematic documents and panels from being refreshed or updated after being locked by the LockViewUpdate method.
UnregisterAndFreeAllConnectionLinesvoidWhen this method is invoked, the connection lines are unregistered and freed from the database associated with the schematic document.
UnRegisterSchObjectFromContainervoidWhen a schematic object is unregistered from the container, it is explicitly freed and cannot be used again.
UpdateDisplayForCurrentSheetvoid
UpdateDocumentPropertiesvoidThis method forces an update of the document properties after the properties have been modified programmatically.

BoundingRectangle_Selected​

The method returns the coordinates of the selected bounding rectangle on the current schematic document.

CoordRect BoundingRectangle_Selected();

Returns: CoordRect

Extension method of ISch_DocumentHelper (using SCH;).

Example: Get the extent of the selected objects on the current schematic sheet in mils.

using SCH;

ISch_Document sheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (sheet == null)
return;
CoordRect rect = sheet.BoundingRectangle_Selected();
int minX = (int)Math.Floor(EDP.Utils.CoordToMils(rect.X1));
int minY = (int)Math.Floor(EDP.Utils.CoordToMils(rect.Y1));
int maxX = (int)Math.Ceiling(EDP.Utils.CoordToMils(rect.X2));
int maxY = (int)Math.Ceiling(EDP.Utils.CoordToMils(rect.Y2));

ChooseLocationInteractively​

To monitor the mouse movement and clicks from your extension, the ISch_Document document interface and its descendant interfaces, ISch_Lib and ISch_Sheet interfaces has several interactive feedback methods. The ChooseLocationInteractively when invoked prompts the user to set the location (point) on the schematic sheet.

bool ChooseLocationInteractively(ref Point argLocation, string argPrompt);
bool ChooseLocationInteractively(ref IPoint argLocation, string argPrompt);
ParameterTypePassing
argLocationPointref
argPromptstringvalue

Returns: bool

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

The ChooseLocationinteractively method can be used to fetch the coordinates of the clicked point on the schematic sheet and can be used for the ISch_HitTest interface.

Example: Ask the user to click a location on the current schematic sheet.

using DXP;
using SCH;

ISch_ServerInterface schServer = SCH.GlobalVars.SchServer;
if (schServer == null)
return;
ISch_Document currentSheet = schServer.GetCurrentSchDocument();
if (currentSheet == null)
return;
var location = new DXP.Point(new SPoint());
// Use the ChooseLocationInteractively method to capture the
// coordinates of the location clicked on the sheet by the user.
if (!currentSheet.ChooseLocationInteractively(ref location, "Please select the location"))
return;

See also: ISch_HitTest

ChooseRectangleInteractively​

To monitor the mouse movement and clicks from your extension, the ISch_Document document interface and its descendant interfaces, ISch_Lib and ISch_Sheet interfaces has several interactive feedback methods. The ChooseRectangleinteractively when invoked prompts the user to set the two corners of the bounding rectangle on the schematic sheet.

bool ChooseRectangleInteractively(ref CoordRect argRect, string argPrompt1, string argPrompt2);
bool ChooseRectangleInteractively(ref ICoordRect argRect, string argPrompt1, string argPrompt2);
ParameterTypePassing
argRectCoordRectref
argPrompt1stringvalue
argPrompt2stringvalue

Returns: bool

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

The ChooseRectangleinteractively method can be used to fetch the coordinates of the bounding rectangle (of TCoordRect type) for the Spatial iterator where it needs the bounds of a rectangle on the schematic document to search within.

Example: Iterate over the junctions and components in an area the user selects.

using SCH;

ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (currentSheet == null)
return;

var rect = new CoordRect();
if (!currentSheet.ChooseRectangleInteractively(ref rect, "Please select the first corner", "Please select the final corner"))
return;

ISch_Iterator spatialIterator = currentSheet.SchIterator_Create();
if (spatialIterator == null)
return;
try
{
spatialIterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eJunction, TObjectId.eSchComponent });
spatialIterator.AddFilter_Area(rect.Left, rect.Bottom, rect.Right, rect.Top);
for (var graphicalObject = spatialIterator.FirstSchObject() as ISch_GraphicalObject; graphicalObject != null;
graphicalObject = spatialIterator.NextSchObject() as ISch_GraphicalObject)
{
// Do what you want with the design object.
}
}
finally
{
currentSheet.SchIterator_Destroy(ref spatialIterator);
}

CountContextMenuObjects​

The method counts the contextual objects based on an object set.

int CountContextMenuObjects(TObjectSet argObjectSet);
int CountContextMenuObjects(ITransportSet argObjectSet);
ParameterTypePassingDescription
argObjectSetTObjectSetvalueThe object set the contextual objects are counted by.

Returns: int

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

Example: Check whether the context menu objects of the current schematic document include components.

using SCH;

ISch_Document schDoc = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
bool visible = (schDoc != null) && (schDoc.CountContextMenuObjects(new SCH.TObjectSet { TObjectId.eSchComponent }) > 0);

See also: TObjectSet

CreateHitTest​

The CreateHitTest method creates an hit test object which is represented by the ISch_HitTest interface with the ATestMode and ALocation parameters.

ISch_HitTest CreateHitTest(THitTestMode argTestMode, Point argLocation);
ParameterTypePassing
argTestModeTHitTestModevalue
argLocationPointvalue

Returns: ISch_HitTest

Extension method of ISch_DocumentHelper (using SCH;).

With this ISch_HitTest interface, the number of objects and the object type at a particular point on the schematic document can be returned.

Example: Report the objects under a location the user clicks on the current schematic sheet.

using DXP;
using SCH;

ISch_Document doc = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (doc == null)
return;
var location = new DXP.Point(new SPoint());
doc.ChooseLocationInteractively(ref location, "Choose a location to click");
THitTestMode hitTestMode = THitTestMode.eHitTest_AllObjects;
ISch_HitTest hitTest = doc.CreateHitTest(hitTestMode, location);
for (int i = 0; i < hitTest.GetState_HitTestCount(); i++)
{
ISch_GraphicalObject prim = hitTest.GetState_HitObject(i);
DXP.Utils.ShowInfo(prim.GetState_ObjectId().ToString()
+ "\r" +
"Location coordinates - "
+ "\r" +
" X= "
+ location.X
+ "\r" +
" Y= "
+ location.Y, "Hit test");
}

See also: ISch_HitTest, THitTestMode, ISch_Document.ChooseLocationInteractively

CreateLibraryFromProject​

This method creates a schematic library based on the components on a schematic project.

void CreateLibraryFromProject(bool argddLibToProject, string argFileName, bool argRunQuiet);
ParameterTypePassingDescription
argddLibToProjectboolvalueIf true, the created library is put in the same project where the components are in.
argFileNamestringvalue
argRunQuietboolvalueIf true, the Information dialog does not come up.

Returns: nothing (void)

Example: Create a schematic library from the components of the current project.

using SCH;

ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if ((currentSheet == null) || (currentSheet.GetState_ObjectId() == TObjectId.eSchLib))
{
DXP.Utils.ShowError("Please run this on a schematic document.", "Create library");
return;
}
currentSheet.CreateLibraryFromProject(true, "NewLibrary.SchLib", false);

GenerateUniqueID​

No description yet.

string GenerateUniqueID();

Returns: string

GetPropsRevisionGUID​

No description yet.

string GetPropsRevisionGUID();

Returns: string

GetPropsVaultGUID​

No description yet.

string GetPropsVaultGUID();

Returns: string

GetTemplateItemGUID​

No description yet.

string GetTemplateItemGUID();

Returns: string

GetTemplateRevisionGUID​

No description yet.

string GetTemplateRevisionGUID();

Returns: string

GetTemplateRevisionHRID​

No description yet.

string GetTemplateRevisionHRID();

Returns: string

GetTemplateVaultGUID​

No description yet.

string GetTemplateVaultGUID();

Returns: string

GetTemplateVaultHRID​

No description yet.

string GetTemplateVaultHRID();

Returns: string

Graphical_VirtualRectangle​

The method returns the coordinates of TCoordRect type of the virtual rectangle of the graphical window in Altium Designer.

CoordRect Graphical_VirtualRectangle();

Returns: CoordRect

Extension method of ISch_DocumentHelper (using SCH;).

Example: Get the extent of the current schematic sheet in mils.

using SCH;

ISch_Document sheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (sheet == null)
return;
CoordRect rect = sheet.Graphical_VirtualRectangle();
int minX = (int)Math.Floor(EDP.Utils.CoordToMils(rect.X1));
int minY = (int)Math.Floor(EDP.Utils.CoordToMils(rect.Y1));
int maxX = (int)Math.Ceiling(EDP.Utils.CoordToMils(rect.X2));
int maxY = (int)Math.Ceiling(EDP.Utils.CoordToMils(rect.Y2));

GridCoordinateClosest​

No description yet.

int GridCoordinateClosest(int argCoord);
ParameterTypePassing
argCoordintvalue

Returns: int

GridCoordinateUp​

No description yet.

int GridCoordinateUp(int argCoord);
ParameterTypePassing
argCoordintvalue

Returns: int

HasServerDocument​

No description yet.

bool HasServerDocument();

Returns: bool

IsInEditorView​

No description yet.

bool IsInEditorView();

Returns: bool

LockViewUpdate​

This method prevents the views of Schematic documents and panels from being refreshed or updated. This is especially used in the situations when a component is being created in the Schematic Library Editor. See the UnLockViewUpdate method.

void LockViewUpdate();

Returns: nothing (void)

See also: ISch_Document.UnLockViewUpdate

Notify_FullUpdate​

No description yet.

void Notify_FullUpdate();

Returns: nothing (void)

ObjectReferenceZone​

The method returns the reference zone string for the design object on the schematic sheet. For example, if a sheet entry object is in the vicinity of Reference Zone C (vertically) and 2 (horizontally) for a Standard Style A document then the method will return a 2C for this sheet entry.

string ObjectReferenceZone(ISch_BasicContainer argObject);
string ObjectReferenceZone(object argObject);
ParameterTypePassing
argObjectISch_BasicContainervalue

Returns: string

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

PopupMenuHitTest​

No description yet.

ISch_HitTest PopupMenuHitTest();

Returns: ISch_HitTest

Extension method of ISch_DocumentHelper (using SCH;).

See also: ISch_HitTest

RecreateHandles​

No description yet.

void RecreateHandles();

Returns: nothing (void)

RedrawToDC​

The DC parameter is a Handle of the canvas (a encapsulation of a device context).

void RedrawToDC(uint argDC, int argPrintKind, int argPrintWhat);
ParameterTypePassing
argDCuintvalue
argPrintKindintvalue
argPrintWhatintvalue

Returns: nothing (void)

RegisterSchObjectInContainer​

The RegisterSchObjectInContainer method registers the object of ISch_BasicContainer type (including its descendants) in the parent object itself. In this case, the document registers a new design object. For example when you create a new port object, you are required to register the port object in the schematic document.

void RegisterSchObjectInContainer(ISch_BasicContainer argObject);
void RegisterSchObjectInContainer(object argObject);
ParameterTypePassing
argObjectISch_BasicContainervalue

Returns: nothing (void)

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

SetPreferencesInfo​

No description yet.

void SetPreferencesInfo(string argVaultGUID, string argRevisionGUID);
ParameterTypePassing
argVaultGUIDstringvalue
argRevisionGUIDstringvalue

Returns: nothing (void)

SetTemplateInfo​

No description yet.

void SetTemplateInfo(string argVaultGUID, string argItemGUID, string argRevisionGUID, string argVaultHRID, string argRevisionHRID);
ParameterTypePassing
argVaultGUIDstringvalue
argItemGUIDstringvalue
argRevisionGUIDstringvalue
argVaultHRIDstringvalue
argRevisionHRIDstringvalue

Returns: nothing (void)

UnLockViewUpdate​

This method allows the views of Schematic documents and panels from being refreshed or updated after being locked by the LockViewUpdate method. This is especially used in the situations when a component is being created in the Schematic Library Editor. See the LockViewUpdate method.

void UnLockViewUpdate();

Returns: nothing (void)

See also: ISch_Document.LockViewUpdate

Examples: Extension_ModifySchWireColor

UnregisterAndFreeAllConnectionLines​

When this method is invoked, the connection lines are unregistered and freed from the database associated with the schematic document.

void UnregisterAndFreeAllConnectionLines();

Returns: nothing (void)

See also: ISch_ConnectionLine

UnRegisterSchObjectFromContainer​

When a schematic object is unregistered from the container, it is explicitly freed and cannot be used again.

void UnRegisterSchObjectFromContainer(ISch_BasicContainer argObject);
void UnRegisterSchObjectFromContainer(object argObject);
ParameterTypePassing
argObjectISch_BasicContainervalue

Returns: nothing (void)

The first overload is an extension method of ISch_DocumentHelper (using SCH;) with typed parameters; the second is declared by the interface.

UpdateDisplayForCurrentSheet​

No description yet.

void UpdateDisplayForCurrentSheet();

Returns: nothing (void)

UpdateDocumentProperties​

This method forces an update of the document properties after the properties have been modified programmatically.

void UpdateDocumentProperties();

Returns: nothing (void)

Inherited members​

Returned by​

IDocumentPainterView.DocumentToPaint, ISch_BasicContainer.OwnerSchDocument, ISch_ServerInterface.GetCurrentSchDocument, ISch_ServerInterface.GetSchDocumentByPath, ISch_ServerInterface.GetSchDocumentBySchDocID, ISch_ServerInterface.LoadSchDocumentByPath

Examples​

Used in the SDK examples: Ciiva, Extension_ModifySchWireColor, Extension_PlaceDeviceSheet, Extension_RefreshDocument.