AutoCAD - Parametric Parameters

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

AutoCAD - Parametric Parameters

Post by keith.lewis » 24 Mar 2020, 20:33

Is it possible to access the parametric parameters within CAD.Net? I have drawing templates that use these parameters to update the drawing. Is there a way to update these parameter expressions via CAD.Net?

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

Re: AutoCAD - Parametric Parameters

Post by support » 24 Mar 2020, 21:25

Hello Keith,

It is possible to access dimensional constraints through a CADDimension.TextOverride property which stores a string containing a name of the dimensional constraint and its value. For example: "d1=1885.8853". CADDimension objects which define the constraints are normally located on the layer *ADSK_CONSTRAINTS.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

Re: AutoCAD - Parametric Parameters

Post by keith.lewis » 24 Mar 2020, 21:52

Thanks for your response. I can see the layer and I was able to quickly output all of the CADDimensions within that layer but I am not getting the names. For instance, we have parameters named WIDTH, HEIGHT, and DEPTH. These parameters are assigned a hard integer value and almost all other constraints work from these values. When I output the dimensions that are on that *ADSK layer, I see mostly the values that are the result of the calculation. I cannot see the actual Name nor the Expression. I inserted a stop point and placed a watch so that I can see the CADDimension properties but I didnt see anywhere that specified the parameter Name nor the Expression. I thought maybe it would be inside the EntName property but there is nothing in there.

Some of the TextOverrides do show the expression now that I look at it again. But some calculate the expression and just show the value.

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

Re: AutoCAD - Parametric Parameters

Post by support » 24 Mar 2020, 22:18

keith.lewis wrote:
24 Mar 2020, 21:52
Some of the TextOverrides do show the expression now that I look at it again. But some calculate the expression and just show the value.
In AutoCAD parameters may contain an expression or just a value:
Image

The TextOverride property stores the string "Name=Expression" (e.g. "dia1=DIA").

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

Re: AutoCAD - Parametric Parameters

Post by keith.lewis » 24 Mar 2020, 22:40

I wish that were the case. Not in my sample though. See below where I have a screenshot of my AutoCAD 2019 parameters list and the quick console app with output where it doesnt show the Name within the TextOverride. Am I missing something?

AutoCAD 2019 Params Window:
The attachment AutoCAD2019_Params.png is no longer available

My Quick Console App with Output:
AutoCAD2019_Params.png
AutoCAD2019_Params.png (4.59 KiB) Viewed 9505 times

Thanks.
Attachments
TestApp_Output.png
TestApp_Output.png (20.69 KiB) Viewed 9505 times

keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

Re: AutoCAD - Parametric Parameters

Post by keith.lewis » 24 Mar 2020, 22:56

Even if it is not an expression, I just need to be able to identify the CABWIDTH, CABDEPTH, etc parameters and change their values. By changing their values it changes a bunch of things within the drawings making it a bit easier. Im just looking for a way to identify those parameters with a specific name and change their value.

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

Re: AutoCAD - Parametric Parameters

Post by support » 24 Mar 2020, 23:23

keith.lewis wrote:
24 Mar 2020, 22:40
I wish that were the case. Not in my sample though. See below where I have a screenshot of my AutoCAD 2019 parameters list and the quick console app with output where it doesnt show the Name within the TextOverride. Am I missing something?
I have used the attached AutoCAD 2010 DXF file for testing. Could you please attach your drawing file for comparison?

Mikhail
Attachments
acad2010_parametric_drawing.zip
Parametric DXF 2010 drawing with dimensional constraints.
(11.34 KiB) Downloaded 547 times
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

Re: AutoCAD - Parametric Parameters

Post by keith.lewis » 25 Mar 2020, 14:28

I am using a dwg file. Can this thread be made private or can I email you the file?

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

Re: AutoCAD - Parametric Parameters

Post by support » 25 Mar 2020, 16:10

keith.lewis wrote:
25 Mar 2020, 14:28
I am using a dwg file. Can this thread be made private or can I email you the file?
You can e-mail the file to support@cadsofttools.com.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

keith.lewis
Posts: 6
Joined: 24 Mar 2020, 20:27

Re: AutoCAD - Parametric Parameters

Post by keith.lewis » 25 Mar 2020, 16:15

Email sent. Thanks.

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

Re: AutoCAD - Parametric Parameters

Post by support » 25 Mar 2020, 21:30

Hello Keith,

Thank you for the file.

For some reason CAD .NET cannot read all the dimensional constraints which use the user parameters (e.g. CABWIDTH, CABDEPTH, HEIGHT) in the expression. For example, "d91=(HEIGHT-(38.75))/2" can be read, while "d44=(CABWIDTH-4)/4" cannot be.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply