Page 1 of 1

Width and height of plt

Posted: 21 Feb 2008, 17:28
by krez0n
Can I get real width and height of plt or dwg file? AbsWidth and AbsHeight always return 1.0 (((

Posted: 26 Feb 2008, 14:33
by support
Hello,

AbsWidth and AbsHeight must return respective values if file is valid.
Could you please send us your files for testing to support@cadsofttools.com?

Sergey.

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

Re: Width and height of plt

Posted: 21 Oct 2008, 13:59
by JaviGonzalez
Hello,

Which unit of measurement does AbsWidth and AbsHeight return?

Re: Width and height of plt

Posted: 21 Oct 2008, 14:09
by support
AbsWidth and AbsHeight return CAD units. These values are being counted basing on entities' coordinates as they are in CAD file.

Sergey.

Re: Width and height of plt

Posted: 21 Oct 2008, 14:49
by JaviGonzalez
Thanks for the quick reply.

do you know if AbsHeight and AbsWidth will return millimeters when i set before the millimeters property (CADImage) to true? (sample code below)

CADImage cadImage = CADImage.CreateImageByExtension(path);
cadImage.Millimeters = true;
double width = cadImage.AbsWidth;
double height = cadImage.AbsHeight;

What will be stored in width and height vars?

Thanks in advance

Re: Width and height of plt

Posted: 21 Oct 2008, 20:58
by ezanagar
I am interested in this thread as well. I am trying to figure out how to calculate my PLT dimensions in inches.

Re: Width and height of plt

Posted: 22 Oct 2008, 11:47
by support
This property is obsolete. Line:

Code: Select all

cadImage.Millimeters = true;
gives nothing.

Sergey.

Re: Width and height of plt

Posted: 22 Oct 2008, 12:05
by JaviGonzalez
So, what's the way to get the real measurements in millimeters, centimeters... of the CAD file?

Re: Width and height of plt

Posted: 22 Oct 2008, 12:50
by support
Can you please describe in detail what do you mean under "real measurements"? CAD file contains the whole data as CAD units, they are neither millimeters nor inches. cadImage.Millimeters defines whether CAD units to be interpreted as millimeters or inches.

Sergey.

Re: Width and height of plt

Posted: 22 Oct 2008, 13:26
by JaviGonzalez
First of all, Is there a correspondence between CAD units and inches or millimeters?

If that correspondence is not generic, I suppose that a particular CAD file should include the information of the picture real dimensions. I mean, a correspondence between cad units and real units (millimeters or inches). Does your library provide this information?

Suppose that you import a CAD file with information from a floor of a building, I must know the real dimensions of that building in 2D (length and width in millimeters or inches)

Re: Width and height of plt

Posted: 22 Oct 2008, 14:47
by support
Dear Javi Gonzalez,

1 inch = 25.4 mm - this is a correspendence beetween these units.
Suppose that you import a CAD file with information from a floor of a building, I must know the real dimensions of that building in 2D (length and width in millimeters or inches)
We import data as it is. The question is how to interpret received data. Everything depends on what exactly this file contains.

Sergey.

Re: Width and height of plt

Posted: 22 Oct 2008, 21:00
by ezanagar
Here is an example PLT file.

When I open this PLT in ABViewer and look at the File Info it tells me that Measurements : 1021x737 mm

How do I get this number in CADImport?

Thanks

E.Z.

Re: Width and height of plt

Posted: 23 Oct 2008, 11:49
by support
Currently exact measurements for PLT files are unavailable in CAD Import .NET. We will inform you when the problem is solved.

Sergey.

Re: Width and height of plt

Posted: 27 Oct 2008, 10:13
by support
Hello!

We recommend to use the following code:

Code: Select all

	double vHeight, vWidth;
	int FMMWidth, FMMHeight;
	vWidth = this.cadImage.PureExtents.right - this.cadImage.PureExtents.left;
	vHeight = this.cadImage.PureExtents.top - this.cadImage.PureExtents.bottom;

	FMMWidth = (int)(vWidth / 40);
	FMMHeight = (int)(vHeight / 40);
it gives result in millimeters.

Sergey.