Page 1 of 1

CADDimension Examples

Posted: 23 Nov 2021, 10:16
by Sing
Hello Mikhail

Your code helped me a lot.( viewtopic.php?f=15&t=10574 )
However, I'd like to know how to create different cases of CADDimension such as diagonal, arc and etc.

Can you provide some example codes for them?
The 'Help' document is not enough for me to understand CADDimension.

Thank you

Re: CADDimension Examples

Posted: 25 Nov 2021, 14:37
by support
Hello,

Thank you for your great question.

Here is an example of creating a diaginal dimension:

Code: Select all

CADDimension dimension = new CADDimension(CADDimension.DimensionType.Aligned, new DPoint(0, 0, 0), new DPoint(-7071, -7071, 0), 5000, true)
            {
                DefPoint = new DPoint(-3535, 10606, 0),
                Style = cadImage.Converter.DimensionStyleByName("DimStyle1"),
                Layer = cadImage.Converter.LayerByName("Dimensions")
            };
            cadImage.Converter.Loads(dimension);
            cadImage.Layouts[0].AddEntity(dimension);
At the moment CAD .NET supports creating only linear dimensions. In the future we hope to be able to add support for more dimension types.

Maria

Re: CADDimension Examples

Posted: 29 Nov 2021, 10:59
by Sing
Hello Mikhail

Thank you for your code.

However, the dimension is broken down when moving a line.
The symptom is the same as the old post.
(viewtopic.php?f=15&t=10574)

Maybe you missed something.

Please check it again.

Thank you.

Re: CADDimension Examples

Posted: 03 Dec 2021, 01:01
by support
Hello Sing,

You are welcome.

As you may know, a diagonal dimension is an Aligned Dimension object in terms of AutoCAD. The problem is that the given code creates a Rotated Dimension object (CADDimension.Flags = 160). We are currently investigating this problem.

Mikhail

Re: CADDimension Examples

Posted: 03 Aug 2022, 10:25
by Noradavis
Hello, Thank you for your great question. Here is an example of creating a diaginal dimension: Code: Select all CADDimension dimension = new ... In CAD, dimension cps tester styles (DimStyles) automate the appearance of dimensions ... In our example, we'll be creating a new DimStyle based on the ...Concept: This tutorial will explain the different types of dimensions which are commonly used in AutoCAD and help you understand their differences.Draws a Line Dimension. Click a line. Draws a Rectangle Dimension. Click a side of a rectangle. Draws the Diameter and Radius Dimension for Circles and Arcs.