
if (swApp != null)
{
// Path to the drawing document
string drawingPath = @"D:\\PROJECT\\Part1-DRAWING.SLDDRW";
// Open the drawing document
// int err = 0;
// int warn = 0;
ModelDoc2 drawingDoc = swApp.OpenDoc6(drawingPath, (int)swDocumentTypes_e.swDocDRAWING,
(int)swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
if (drawingDoc != null)
{
System.Console.WriteLine("Drawing document opened successfully.");
Console.WriteLine(drawingDoc.GetTitle());
DrawingDoc swDrawing = (DrawingDoc)drawingDoc;
// Get all sheets in the drawing
object[] sheetNames = (object[])swDrawing.GetSheetNames();
foreach (string sheetName in sheetNames)
{
// Activate the sheet to iterate over its views
swDrawing.ActivateSheet(sheetName);
Sheet swSheet = (Sheet)swDrawing.GetCurrentSheet();
object[] views = (object[])swSheet.GetViews();
foreach (View swView in views)
{
// Check if the view is a flat pattern view
if (swView.IsFlatPatternView())
{
// Perform your action here
System.Console.WriteLine("Flat Pattern View found on sheet :" + sheetName);
// Example: Get the flat pattern feature
string viewName = swView.GetName2();
System.Console.WriteLine( "FLAT PATTERN VIEW NAME IS :" + viewName);
//PRINT NAME OF CUT LIST FOLDER FROM WHICH FOLDER FLAT PATTERN BODY BELONG TO
}
}
}
}
else
{
System.Console.WriteLine("Failed to open drawing document. Errors: " + errors);
}
}