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
| Property | Type | Access | Description |
|---|---|---|---|
| BorderOn | bool | get; set | This BorderOn property determines whether the border on around the outside of the current schematic document will be displayed or not. |
| CustomMarginWidth | int | get; set | The CustomMarginWidth property sets the margin from the bounds of the schematic sheet inwards. |
| CustomSheetStyle | string | get; set | This property represents custom sheet style property which values can be inherited from one of the standard sheet styles and customized further. |
| CustomX | int | get; set | This property sets the width of the custom sheet for the document. |
| CustomXZones | int | get; set | This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. |
| CustomY | int | get; set | This property sets the height of the custom sheet for the document. |
| CustomYZones | int | get; set | This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. |
| DocumentBorderStyle | TSheetDocumentBorderStyle | get; set | The DocumentBorderStyle property determines the current document/border style for the schematic sheet - whether it is a standard or an ANSI title block. |
| DocumentName | string | get | This read only property determines the schematic document name. |
| HotspotGridOn | bool | get; set | |
| HotspotGridSize | int | get; set | |
| InternalTolerance | int | get | |
| LoadFormat | string | get; set | |
| MinorVersion | int | get | |
| ReferenceZonesOn | bool | get; set | This property determines the number of regions or reference zones that are displayed along the horizontal and vertical borders. |
| SchDocID | int | get | |
| SheetMarginWidth | int | get; set | The SheetMarginWidth property sets the margin from the bounds of the schematic sheet inwards. |
| SheetSizeX | int | get; set | The SheetSizeX property defines the width of the sheet. |
| SheetSizeY | int | get; set | The SheetSizeY property defines the height of the sheet. |
| SheetStyle | TSheetStyle | get; set | The SheetStyle property determines the document standard style. |
| SheetZonesX | int | get; set | |
| SheetZonesY | int | get; set | |
| ShowTemplateGraphics | bool | get; set | The template is usually placed on the bottom right of the schematic sheet. |
| SnapGridOn | bool | get; set | The snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet. |
| SnapGridSize | int | get; set | The snap grid is the grid that the cursor is locked to when placing or manipulating objects on the sheet. |
| SystemFont | int | get; set | |
| TemplateFileName | string | get; set | The template filename is the filename of the template that is placed usually on the bottom right of the schematic sheet. |
| TitleBlockOn | bool | get; set | |
| Unit | TUnit | get; set | This property determines the system unit used for the schematic project. |
| UnitSystem | TUnitSystem | get | |
| UseCustomSheet | bool | get; set | The property determines whether a custom sheet is used instead of a standard sheet. |
| VisibleGridOn | bool | get; set | The electrical grid supports the Schematic Editor's guided wiring feature. |
| VisibleGridSize | int | get; set | |
| WorkspaceOrientation | TSheetOrientation | get; set | This 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
| Method | Returns | Description |
|---|---|---|
| BoundingRectangle_Selected | CoordRect | The method returns the coordinates of the selected bounding rectangle on the current schematic document. |
| ChooseLocationInteractively | bool | 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 m… |
| ChooseRectangleInteractively | bool | 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 m… |
| CountContextMenuObjects | int | The method counts the contextual objects based on an object set. |
| CreateHitTest | ISch_HitTest | The CreateHitTest method creates an hit test object which is represented by the ISch_HitTest interface with the ATestMode and ALocation parameters. |
| CreateLibraryFromProject | void | This method creates a schematic library based on the components on a schematic project. |
| GenerateUniqueID | string | |
| GetPropsRevisionGUID | string | |
| GetPropsVaultGUID | string | |
| GetTemplateItemGUID | string | |
| GetTemplateRevisionGUID | string | |
| GetTemplateRevisionHRID | string | |
| GetTemplateVaultGUID | string | |
| GetTemplateVaultHRID | string | |
| Graphical_VirtualRectangle | CoordRect | The method returns the coordinates of TCoordRect type of the virtual rectangle of the graphical window in Altium Designer. |
| GridCoordinateClosest | int | |
| GridCoordinateUp | int | |
| HasServerDocument | bool | |
| IsInEditorView | bool | |
| LockViewUpdate | void | This method prevents the views of Schematic documents and panels from being refreshed or updated. |
| Notify_FullUpdate | void | |
| ObjectReferenceZone | string | The method returns the reference zone string for the design object on the schematic sheet. |
| PopupMenuHitTest | ISch_HitTest | |
| RecreateHandles | void | |
| RedrawToDC | void | The DC parameter is a Handle of the canvas (a encapsulation of a device context). |
| RegisterSchObjectInContainer | void | The RegisterSchObjectInContainer method registers the object of ISch_BasicContainer type (including its descendants) in the parent object itself. |
| SetPreferencesInfo | void | |
| SetTemplateInfo | void | |
| UnLockViewUpdate | void | This method allows the views of Schematic documents and panels from being refreshed or updated after being locked by the LockViewUpdate method. |
| UnregisterAndFreeAllConnectionLines | void | When this method is invoked, the connection lines are unregistered and freed from the database associated with the schematic document. |
| UnRegisterSchObjectFromContainer | void | When a schematic object is unregistered from the container, it is explicitly freed and cannot be used again. |
| UpdateDisplayForCurrentSheet | void | |
| UpdateDocumentProperties | void | This 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);
| Parameter | Type | Passing |
|---|---|---|
argLocation | Point | ref |
argPrompt | string | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argRect | CoordRect | ref |
argPrompt1 | string | value |
argPrompt2 | string | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argObjectSet | TObjectSet | value | The 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);
| Parameter | Type | Passing |
|---|---|---|
argTestMode | THitTestMode | value |
argLocation | Point | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argddLibToProject | bool | value | If true, the created library is put in the same project where the components are in. |
argFileName | string | value | |
argRunQuiet | bool | value | If 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);
| Parameter | Type | Passing |
|---|---|---|
argCoord | int | value |
Returns: int
GridCoordinateUp
No description yet.
int GridCoordinateUp(int argCoord);
| Parameter | Type | Passing |
|---|---|---|
argCoord | int | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argObject | ISch_BasicContainer | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argDC | uint | value |
argPrintKind | int | value |
argPrintWhat | int | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argObject | ISch_BasicContainer | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argVaultGUID | string | value |
argRevisionGUID | string | value |
Returns: nothing (void)
SetTemplateInfo
No description yet.
void SetTemplateInfo(string argVaultGUID, string argItemGUID, string argRevisionGUID, string argVaultHRID, string argRevisionHRID);
| Parameter | Type | Passing |
|---|---|---|
argVaultGUID | string | value |
argItemGUID | string | value |
argRevisionGUID | string | value |
argVaultHRID | string | value |
argRevisionHRID | string | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argObject | ISch_BasicContainer | value |
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
- From ISch_ParametrizedGroup: Import_FromUser_Parameters, ResetAllSchParametersPosition
- From ISch_GraphicalObject: AddErrorString, AreaColor, BoundingRectangle, BoundingRectangle_Full, Color, CompilationMasked, Dimmed, Disabled, DisplayError, EnableDraw, ErrorColor, ErrorKind, ErrorString, GetHash, GraphicallyInvalidate, LiveHighlightValue, Location, Mirror, MoveByXY, MoveToXY, OwnerPartDisplayMode, OwnerPartId, ResetErrorFields, RotateBy90, Selection, SetState_xSizeySize
- From ISch_BasicContainer: AddAndPositionSchObject, AddSchObject, CopyTo, DeleteAll, DescriptionString, ExportToParameters, FreeAllContainedObjects, Handle, IdentifierString, Import_FromUser, ObjectId, OwnerSchDocument, RemoveSchObject, Replicate, SchBasicContainer, SchIterator_Create, SchIterator_Destroy, SchParameterByName, Setstate_Default, Text, UniqueId, WiringDiagramOriginUniqueId
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.