Generation of DXF|Documentation

i have another request for documentation. I’m trying to add some dimension objects to the example i previously posted. i’m trying to insert a rotated dimension into the example drawing. below is the updated code with the additional entity.

        DxfImage dxfImage = new DxfImage(Aspose.CAD.FileFormats.Cad.CadConsts.CadAcadVersion.AC1024);
        //LINE, CIRCLE, ARC, TEXT, POINT, SOLID, 3DFACE and POLYLINE

        //add line
        CadLine line = new(new Cad3DPoint(0, 0, 0), new Cad3DPoint(100, 100, 100))
        {
            LineWeight = 3,
            ColorValue = global::Aspose.CAD.Color.Orange.ToArgb()
        };
        dxfImage.AddEntity(line);

        //add circle
        CadCircle circle = new(new Cad3DPoint(50, 0), 10)
        {
            LineWeight = 3,
            ColorValue = global::Aspose.CAD.Color.Blue.ToArgb()
        };
        dxfImage.AddEntity(circle);

        //add arc
        CadArc arc = new(new Cad3DPoint(100, 0), 10, 45, 135)
        {
            ColorValue = global::Aspose.CAD.Color.OrangeRed.ToArgb(),
            LineWeight = 3,
        };
        dxfImage.AddEntity(arc);

        CadText text = new()
        {
            FirstAlignment = new Cad3DPoint(0, -50, 0),
            TextHeight = 10,
            ColorValue = global::Aspose.CAD.Color.Black.ToArgb(),
            DefaultValue = "text value"
        };
        dxfImage.AddEntity(text);

        CadPoint point = new()
        {
            CenterPoint = new Cad3DPoint(-10, -10, -10),
            ColorValue = global::Aspose.CAD.Color.Green.ToArgb(),
            LineWeight = 3,
            Radius = 4,
        };
        dxfImage.AddEntity(point);

        CadMText watermark = new()
        {
            ColorValue = global::Aspose.CAD.Color.Red.ToArgb(),
            Text = "Watermark message",
            InitialTextHeight = 10,
            InsertionPoint = new Cad3DPoint(100, 40),
            LayerName = "0"
        };
        dxfImage.AddEntity(watermark);

        CadRotatedDimension rotated = new()
        {
            DefinitionPoint1 = new Cad3DPoint(0, 0, 0),
            DefinitionPoint2 = new Cad3DPoint(100, 100, 0),
            InsertionPoint = new Cad3DPoint(50, 50, 0),
            ExtensionLineAngle = 0,
            RotationAngle = 0
        };
        dxfImage.AddEntity(rotated);

        using var stream = new MemoryStream();
        dxfImage.UpdateSize();
        dxfImage.Save(stream, new PngOptions
        {
            VectorRasterizationOptions = new CadRasterizationOptions()
            {
                AutomaticLayoutsScaling = true,
                BackgroundColor = Aspose.CAD.Color.White,
                DrawColor = Aspose.CAD.Color.Blue,
                DrawType = CadDrawTypeMode.UseObjectColor,
                PageHeight = 640,
                PageWidth = 640,
                NoScaling = false,
                ScaleMethod = ScaleType.ShrinkToFit
            }
        });

@kevin.kilburn,
the structure of dimension is complex as it uses special internal block in the file to store details of the structure of dimension. Please give us some time to investigate if this is feasible, I will come back with more information.

@kevin.kilburn,
Hello,
unfortunately there is no such ability to create new Dimension and write it properly. We have created CADNET-9996 to investigate this. There is a requirement for dimensions to have internal block with its structure inside the file and when it is missing, different viewers/exporters may react differently. For instance, ODA viewer can open the DXF file created with your example, partially recovering structure of dimension, but AutoCAD can not.