Testing Code posting
using System;
using Manifold.Interop;
using Manifold.Interop.Scripts;
class Test
{
static void Main()
{
Document doc = (Document) Context.Application.ActiveDocument;
History logBook = (History) Context.Application.History;
bool isPopUp = true;
string newLine = "\r\n";
Drawing draw = (Drawing) doc.ComponentSet[ "Total Migration" ];
RecordSet drawRecords = ((Table)draw.OwnedTable).RecordSet;
string message = "Number of objects: " + draw.ObjectSet.Count + newLine;
logBook.Log( message, isPopUp );
message = "";
double[] bearings = new double[ draw.ObjectSet.Count ];
Point[] initPoints = new Point[ draw.ObjectSet.Count ];
int counter = 0;
foreach( Manifold.Interop.Object lineObject in draw.ObjectSet )
{
bearings[ counter ] =
(double) drawRecords[ drawRecords.ItemByID( lineObject.ID )].
get_Data("Bearing (I)");
message += "Line ID: " + lineObject.ID + " \tBearing: " +
bearings[ counter++ ] + newLine;
}
logBook.Log( "Line Bearings:\r\n" + message, isPopUp );
}
}
using Manifold.Interop;
using Manifold.Interop.Scripts;
class Test
{
static void Main()
{
Document doc = (Document) Context.Application.ActiveDocument;
History logBook = (History) Context.Application.History;
bool isPopUp = true;
string newLine = "\r\n";
Drawing draw = (Drawing) doc.ComponentSet[ "Total Migration" ];
RecordSet drawRecords = ((Table)draw.OwnedTable).RecordSet;
string message = "Number of objects: " + draw.ObjectSet.Count + newLine;
logBook.Log( message, isPopUp );
message = "";
double[] bearings = new double[ draw.ObjectSet.Count ];
Point[] initPoints = new Point[ draw.ObjectSet.Count ];
int counter = 0;
foreach( Manifold.Interop.Object lineObject in draw.ObjectSet )
{
bearings[ counter ] =
(double) drawRecords[ drawRecords.ItemByID( lineObject.ID )].
get_Data("Bearing (I)");
message += "Line ID: " + lineObject.ID + " \tBearing: " +
bearings[ counter++ ] + newLine;
}
logBook.Log( "Line Bearings:\r\n" + message, isPopUp );
}
}

0 Comments:
Post a Comment
<< Home