Insert Geometries in drawings (advanced)
public void CreateGeometryOut()//Criar rectangulo no desenho
{
DrawingHandler MyDrawingHandler = new DrawingHandler();
//ViewBase view = MyDrawingHandler.GetActiveDrawing().GetSheet().GetAllViews().Current as ViewBase;
Tekla.Structures.Drawing.ViewBase view = MyDrawingHandler.GetActiveDrawing().GetSheet() as Tekla.Structures.Drawing.ViewBase;
TSD.Polygon MyPolygon;
PointList PolygonPoints = new PointList();
PolygonPoints.Add(new TSG.Point(5, 5));
PolygonPoints.Add(new TSG.Point(185, 5));
PolygonPoints.Add(new TSG.Point(185, 292));
PolygonPoints.Add(new TSG.Point(5, 292));
TSD.Polygon MyPolygon2;
PointList PolygonPoints2 = new PointList();
PolygonPoints.Add(new TSG.Point(5, 77));
PolygonPoints.Add(new TSG.Point(185, 77));
PolygonPoints.Add(new TSG.Point(185, 150));
PolygonPoints.Add(new TSG.Point(5, 150));
TSD.Polygon.PolygonAttributes PolyProps = new TSD.Polygon.PolygonAttributes();
PolyProps.Hatch.Name = "None";
PolyProps.Hatch.Color = DrawingHatchColors.Magenta;
PolyProps.Hatch.BackgroundColor = TSD.DrawingHatchColors.Red;
PolyProps.Line.Color = DrawingColors.Gray90;
MyPolygon = new TSD.Polygon(MyDrawingHandler.GetActiveDrawing().GetSheet(), PolygonPoints , PolyProps);
MyPolygon.Insert();
MyPolygon2 = new TSD.Polygon(MyDrawingHandler.GetActiveDrawing().GetSheet(), PolygonPoints, PolyProps);
MyPolygon2.Insert();
}
{
DrawingHandler MyDrawingHandler = new DrawingHandler();
//ViewBase view = MyDrawingHandler.GetActiveDrawing().GetSheet().GetAllViews().Current as ViewBase;
Tekla.Structures.Drawing.ViewBase view = MyDrawingHandler.GetActiveDrawing().GetSheet() as Tekla.Structures.Drawing.ViewBase;
TSD.Polygon MyPolygon;
PointList PolygonPoints = new PointList();
PolygonPoints.Add(new TSG.Point(5, 5));
PolygonPoints.Add(new TSG.Point(185, 5));
PolygonPoints.Add(new TSG.Point(185, 292));
PolygonPoints.Add(new TSG.Point(5, 292));
TSD.Polygon MyPolygon2;
PointList PolygonPoints2 = new PointList();
PolygonPoints.Add(new TSG.Point(5, 77));
PolygonPoints.Add(new TSG.Point(185, 77));
PolygonPoints.Add(new TSG.Point(185, 150));
PolygonPoints.Add(new TSG.Point(5, 150));
TSD.Polygon.PolygonAttributes PolyProps = new TSD.Polygon.PolygonAttributes();
PolyProps.Hatch.Name = "None";
PolyProps.Hatch.Color = DrawingHatchColors.Magenta;
PolyProps.Hatch.BackgroundColor = TSD.DrawingHatchColors.Red;
PolyProps.Line.Color = DrawingColors.Gray90;
MyPolygon = new TSD.Polygon(MyDrawingHandler.GetActiveDrawing().GetSheet(), PolygonPoints , PolyProps);
MyPolygon.Insert();
MyPolygon2 = new TSD.Polygon(MyDrawingHandler.GetActiveDrawing().GetSheet(), PolygonPoints, PolyProps);
MyPolygon2.Insert();
}
Comentários
Enviar um comentário