Measurement Unit and MMToPixelX property
Moderators: SDS, support, admin
-
- Posts: 26
- Joined: 17 Oct 2007, 06:46
- Location: Malaysia
- Contact:
Measurement Unit and MMToPixelX property
Hi,
Is there any way that I can find the default physical measurement unit, i.e. milimeter, inch, etc. that is used in the CAD drawing? It seems to me that the only property that I found that is somewhat related to measurement unit is the MMToPixelX property of CADImage.
What is this anyway? From the help file, my guess is the value is the number of milimeters that each unit in the CADImage represent? Thus, if I have two points returned from CADImage that is at (0, 0) and (0, 10), with MMToPixelX having a value of 0.1, meaning that the distance between that two points is 1 millimeter? Does this apply to other dimension as well, i.e. Y and Z dimension, as the "X" at the end of MMToPixelX looks a bit suspecious to me.
Also, how reliable is this property? Is it always available? As far as I know, a user create a DXF files in AutoCAD that is "unitless". In this case, what is the expected value of MMToPixelX. What if the unit set by the user is in units other than millimeter? Does CADImport will convert them to MM automatically to produce consistent result for the MMToPixelX property?
I know there is a lot of questions here. But I really need to find out how can I retrieve the physical measurement unit information from the DXF file.
Thanks. Any help is grealy appreciated.
<b>Objective World Pvt. Ltd.</b>
"<i>Turning Knowledge Into Wisdom.</i>"
http://www.objectiveworld.com
Is there any way that I can find the default physical measurement unit, i.e. milimeter, inch, etc. that is used in the CAD drawing? It seems to me that the only property that I found that is somewhat related to measurement unit is the MMToPixelX property of CADImage.
What is this anyway? From the help file, my guess is the value is the number of milimeters that each unit in the CADImage represent? Thus, if I have two points returned from CADImage that is at (0, 0) and (0, 10), with MMToPixelX having a value of 0.1, meaning that the distance between that two points is 1 millimeter? Does this apply to other dimension as well, i.e. Y and Z dimension, as the "X" at the end of MMToPixelX looks a bit suspecious to me.
Also, how reliable is this property? Is it always available? As far as I know, a user create a DXF files in AutoCAD that is "unitless". In this case, what is the expected value of MMToPixelX. What if the unit set by the user is in units other than millimeter? Does CADImport will convert them to MM automatically to produce consistent result for the MMToPixelX property?
I know there is a lot of questions here. But I really need to find out how can I retrieve the physical measurement unit information from the DXF file.
Thanks. Any help is grealy appreciated.

<b>Objective World Pvt. Ltd.</b>
"<i>Turning Knowledge Into Wisdom.</i>"
http://www.objectiveworld.com
Hello Thomas,
There is no such term as "units by default". All values in AutoCAD drawings are abstract, which may be interpreted as enches or millimeters.
MMToPixelX - this parameter views how many millimeters in on screen pixel. It is an auxiliary value which is used when viewing or printing a drawing with 1:1 scale.
When viewing or printing a drawing with 1:1 scale in Viewer demo it is set that drawing units are millimeters by default.
Drawing area must be multiplied by 25.4 if a drawing is ment in enches. I.e. resulting rect in GetRealSize must be multiplied by 25.4.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
There is no such term as "units by default". All values in AutoCAD drawings are abstract, which may be interpreted as enches or millimeters.
MMToPixelX - this parameter views how many millimeters in on screen pixel. It is an auxiliary value which is used when viewing or printing a drawing with 1:1 scale.
When viewing or printing a drawing with 1:1 scale in Viewer demo it is set that drawing units are millimeters by default.
Drawing area must be multiplied by 25.4 if a drawing is ment in enches. I.e. resulting rect in GetRealSize must be multiplied by 25.4.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com