Добрый день! Пытаюсь построить операцию "листовая заготовка" по профилю:
[CODE]using System;
using TFlex.Model;
using TFlex.Model.Model2D;
using TFlex.Model.Model3D;
namespace NewMacroNamespace
{
public class NewMacroClass
{
public static void NewMacroPrefab()
{
Document document = TFlex.Application.ActiveDocument;//Получение активного документа
document.BeginChanges("Построение и выталкивание");//Открытие блока изменений документа
PathConstruction pathConstruction = new PathConstruction(document);
TFlex.Model.Model2D.Contour cn = pathConstruction.Contour;//контур
//создание узлов
FreeNode fn1 = new FreeNode(document, 20, 60);
FreeNode fn2 = new FreeNode(document, 120, 60);
FreeNode fn3 = new FreeNode(document, 20, 20);
FreeNode fn4 = new FreeNode(document, 120, 20);
//соединяем узлы линиями
ConstructionOutline l1 = new ConstructionOutline(document, fn1, fn2);
ConstructionOutline l2 = new ConstructionOutline(document, fn2, fn4);
ConstructionOutline l3 = new ConstructionOutline(document, fn4, fn3);
ConstructionOutline l4 = new ConstructionOutline(document, fn3, fn1);
//отнесение этих линий к контуру
OutlineContourSegment s1 = new OutlineContourSegment(cn);
OutlineContourSegment s2 = new OutlineContourSegment(cn);
OutlineContourSegment s3 = new OutlineContourSegment(cn);
OutlineContourSegment s4 = new OutlineContourSegment(cn);
s1.Outline = l1; s2.Outline = l2; s3.Outline = l3;s4.Outline = l4;
//создание штриховки
Area ar = new Area (document);
TFlex.Model.Model2D.Contour cn1 = ar.AppendContour();
//путь
ConstructionContourSegment seg1 = new ConstructionContourSegment(cn1);
seg1.Construction = pathConstruction;
StandardWorkplane swp1 = new StandardWorkplane(document, StandardWorkplane.StandardType.Top);
// Создаем 3D-профиль на основе штриховки и рабочей плоскости
AreaProfile ap1 = new AreaProfile(document);
ap1.Area = ar;
ap1.WorkSurface = swp1;
document.ApplyChanges();
document.EndChanges();
//-----------------------------------------------------------------
document.BeginChanges("3Д");
SheetMetalPart smp = new SheetMetalPart(document);
smp.Profiles.Add(ap1.Geometry.SheetContour);
smp.Type = SheetMetalPart.ExtrusionType.Summary;
smp.Thickness = 1;
document.ApplyChanges();
document.EndChanges();
}
}
}
[/CODE]
Сам профиль создаётся, операция выталкивания с ним тоже работает. Такое ощущение, что я упускаю какой-то параметр. Подскажите, пожалуйста, что именно тут не так.