using System;
namespace drawings
{
class Program
{
static void ExploreSheet(
Sheet theSheet)
{
uint aViewCounter = 0;
while (aViewIt.HasNext())
{
View aView = aViewIt.Next();
Console.WriteLine("---- View <" + aViewCounter + ">");
DrawingElementVisitor aVisitor = new DrawingElementVisitor();
aViewCounter++;
}
}
static void ExploreDrawing(
Drawing theDrawing)
{
uint aSheetCounter = 0;
while(aSheetIt.HasNext())
{
Sheet aSheet = aSheetIt.Next();
Console.WriteLine("-- Sheet <" + aSheetCounter + ">");
ExploreSheet(aSheet);
aSheetCounter++;
}
}
static int Main(string[] args)
{
string aKey = MTKLicenseKey.Value();
{
Console.WriteLine("Failed to activate Manufacturing Toolkit license.");
return 1;
}
if (args.Length != 1)
{
Console.WriteLine("Usage: " +
$"{System.Reflection.Assembly.GetExecutingAssembly().Location} <input_file>, where:");
Console.WriteLine($" <input_file> is a name of the file to be read");
Console.WriteLine($"");
return 1;
}
string aSource = args[0];
{
Console.WriteLine("Failed to read the file " + aSource);
return 1;
}
Drawing aDrawing = aModel.
Drawing();
{
Console.WriteLine("The model doesn't contain a drawing");
return 1;
}
Console.WriteLine(
"Drawing \"" + aModel.
Name() +
"\":");
ExploreDrawing(aDrawing);
return 0;
}
}
{
public override void Apply(
CurveSet theElement)
{
Console.WriteLine("------- CurveSet <" + myCurveSetCounter + ">");
Console.WriteLine(
"------- number of curves: " + theElement.
NumberOfCurves());
myCurveSetCounter++;
}
private uint myCurveSetCounter = 0;
}
}
Describes drawing elements composed of 2D curves.
Definition CurveSet.cs:20
uint NumberOfCurves()
Returns the number of curves currently composing the element.
Definition CurveSet.cs:67
Iterator over sheets of a drawing.
Definition Drawing.cs:108
Represents a single 2D drawing of a model.
Definition Drawing.cs:33
Defines a visitor for drawing elements with empty implementation.
Definition ElementVoidVisitor.cs:20
Iterates over views of a drawing sheet.
Definition Sheet.cs:177
Represents a single sheet of a model drawing.
Definition Sheet.cs:33
Represents a view on a drawing sheet.
Definition View.cs:24
Activates the license key.
Definition LicenseManager.cs:48
Provides MTK data model.
Definition Model.cs:30
cadex.UTF16String Name()
Returns a model name.
Definition Model.cs:93
Reads supported formats, see Import section.
Definition ModelReader.cs:17
bool Read(cadex.UTF16String theFilePath, cadex.ModelData.Model theModel)
Reads the file at the specified path into the specified model.
Definition ModelReader.cs:86
void SetParameters(cadex.ModelData.ModelReaderParameters theParameters)
Sets reader parameters.
Definition ModelReader.cs:67
Defines parameters of the ModelReader.
Definition ModelReaderParameters.cs:19
void SetReadDrawing(bool theReadDrawing)
Sets whether a drawing should be read from the file.
Definition ModelReaderParameters.cs:98
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.cs:17
Contains classes, types and enums related to drawings.
Definition AngularDimension.cs:12
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Definition AngleUnit.cs:12
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition BaseObject.cs:12