CADDimension Examples

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Sing
Posts: 48
Joined: 12 Apr 2020, 17:39

CADDimension Examples

Post by Sing » 23 Nov 2021, 10:16

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

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Re: CADDimension Examples

Post by support » 25 Nov 2021, 14:37

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Sing
Posts: 48
Joined: 12 Apr 2020, 17:39

Re: CADDimension Examples

Post by Sing » 29 Nov 2021, 10:59

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.

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Re: CADDimension Examples

Post by support » 03 Dec 2021, 01:01

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Noradavis
Posts: 1
Joined: 03 Aug 2022, 10:22
Location: United States
Contact:

Re: CADDimension Examples

Post by Noradavis » 03 Aug 2022, 10:25

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.

Post Reply