How to access dimensions?

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
dkrphil
Posts: 5
Joined: 30 Apr 2007, 00:46
Location: United Kingdom

How to access dimensions?

Post by dkrphil » 30 Apr 2007, 00:54

Can you tell me how to get the actual numbers of the dimensions in a CAD image? I've seen how I can turn them on and off with CADImage.DimensionsVisible, but I want the actual values.

Or any other way to reliably get the physical sizes in a drawing?

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

Post by support » 02 May 2007, 10:42

Hello!

The following code is based on <b>Viewer</b> demo:

Code: Select all

<font color="blue">private void</font id="blue"> btnGetDimensions_Click(<font color="blue">object</font id="blue"> sender, System.EventArgs e)
{
	<font color="blue">if</font id="blue">(<font color="blue">this</font id="blue">.FCADImage == <font color="blue">null</font id="blue">) <font color="blue">return</font id="blue">;
	<font color="blue">int</font id="blue"> DimNumber = 0;		
	<font color="blue">for</font id="blue">(<font color="blue">int</font id="blue"> i = 0; i < this.FCADImage.CurrentLayout.Count; i++)
	{
		<font color="blue">if</font id="blue"> (<font color="blue">this</font id="blue">.FCADImage.CurrentLayout.Entities[i] <font color="blue">is</font id="blue"> CADDimension)				
			DimNumber++;				
	}		
	MessageBox.Show(<font color="blue">string</font id="blue">.Format("Dimensions number is - {0}", DimNumber));
}
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Or any other way to reliably get the physical sizes in a drawing?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It depends on what exactly you want to get. In the general case it is necessary to analyze <b>Box</b> parameter of the entity.

Sergey.


Please post questions to the forum or write to support@cadsofttools.com

Post Reply