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
| Property | Type | Access | Description |
|---|---|---|---|
| AutoWire | bool | get; set | |
| CompilationMaskedSegment | bool | get; set | |
| EditingEndPoint | bool | get; set | |
| UnderlineColor | int | get; 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
| Method | Returns | Description |
|---|---|---|
| OrderCrossOverArray | void | |
| ResetCompilationMaskedSegments | void |
OrderCrossOverArray
No description yet.
void OrderCrossOverArray();
Returns: nothing (void)
ResetCompilationMaskedSegments
No description yet.
void ResetCompilationMaskedSegments();
Returns: nothing (void)
Inherited members
- From ISch_BasicPolyline: LineStyle
- From ISch_Polygon: ClearAllVertices, InsertVertex, IsSolid, LineWidth, RemoveVertex, Transparent, Vertex, VerticesCount
- 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
Examples
Used in the SDK examples: Extension_ModifySchWireColor.