Skip to main content
View as Markdown

ISch_Wire interface

Wires are straight line segments which are placed on a schematic document to create the electrical connections.

public interface ISch_Wire : ISch_BasicPolyline

Namespace: SCH · Assembly: Altium.SDK.Interfaces

Inherits: ISch_BasicContainer → ISch_GraphicalObject → ISch_Polygon → ISch_BasicPolyline

Derived: ISch_Bus, ISch_HarnessBundle, ISch_HarnessWire

Remarks​

ReportList.Add('Wire #'

ReportList.Add('X: '

  • ', Y: '

Example​

Report the vertices of every wire on the current schematic sheet.

using System.Collections.Generic;
using System.IO;
using DXP;
using SCH;

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

// Set up an iterator to look for wire objects only.
ISch_Iterator iterator = schDoc.SchIterator_Create();
iterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eWire });
int wireCount = 0;
var reportList = new List<string>();
reportList.Add("Wires' Vertex report:");
reportList.Add("______________________");
reportList.Add("");
try
{
var wire = iterator.FirstSchObject() as ISch_Wire;
while (wire != null)
{
wireCount++;
reportList.Add("Wire #" + wireCount);
for (int index = 1; index <= wire.GetState_VerticesCount(); index++)
{
DXP.Point location = wire.GetState_Vertex(index);
reportList.Add("X: " + location.X + ", Y: " + location.Y);
}
reportList.Add("");
wire = iterator.NextSchObject() as ISch_Wire;
}
}
finally
{
schDoc.SchIterator_Destroy(ref iterator);
}

string reportPath = Path.Combine(Path.GetTempPath(), "WireVertexReport.txt");
File.WriteAllLines(reportPath, reportList);
// Display the report.
IClient client = DXP.GlobalVars.Client;
IServerDocument document = client.OpenDocument("Text", reportPath);
if (document != null)
client.ShowDocument(document);

Properties​

PropertyTypeAccessDescription
AutoWireboolget; set
CompilationMaskedSegmentboolget; set
EditingEndPointboolget; set
UnderlineColorintget; set

AutoWire​

No description yet.

bool GetState_AutoWire();
void SetState_AutoWire(bool argValue);

Type: bool · Access: read/write

CompilationMaskedSegment​

No description yet.

bool GetState_CompilationMaskedSegment(int argIndex);
void SetState_CompilationMaskedSegment(int argIndex, bool argValue);

Type: bool · Access: read/write · Index: argIndex (int)

EditingEndPoint​

No description yet.

bool GetState_EditingEndPoint();
void SetState_EditingEndPoint(bool argValue);

Type: bool · Access: read/write

UnderlineColor​

No description yet.

int GetState_UnderlineColor();
void SetState_UnderlineColor(int argValue);

Type: int · Access: read/write

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

Methods​

MethodReturnsDescription
OrderCrossOverArrayvoid
ResetCompilationMaskedSegmentsvoid

OrderCrossOverArray​

No description yet.

void OrderCrossOverArray();

Returns: nothing (void)

ResetCompilationMaskedSegments​

No description yet.

void ResetCompilationMaskedSegments();

Returns: nothing (void)

Inherited members​

Examples​

Used in the SDK examples: Extension_ModifySchWireColor.