Toad World® Forums

Unit of top, bottom, left and right property of WorkSpaceShape... classes

What unit do the above properties have? I suspect it's mm.
Since the data type is integer, floating point values are probably not possible?

The same questions apply to the PenWidth property.

BR
Dirk

Hi Dirk,

Unit in shapes is in tenths of mm.
PenWidth is in pixels.

Regards,

Mario

Hi Mario,

One more quick question about that:
Is there a fixed factor of conversion (dpi or dpmm :slight_smile: )

Regards,
Dirk

Hi Dirk,

What do you want exactly convert (e.g. convert shape measurement from mm to pixel)?

Convert from pixel to mm is relatively complicated - some simple formula is not exist.

Shape objects are not displayed in mm, but it should be fit on printed copy.

Regards,

Mario

I was hoping to convert pixel to mm.
I've a script that places / arranges some objects and I would like to take the PenWidth into account.

Dirk

Hi Dirk,

When Mario wrote, that shape sizes are in tenths mm, it mean that when you print it to paper it will be in mm, but not on screen. TDM preserve ratio between page size and shape sizes, but displayed shape is not in mm.
How it is displayed it is dependent on device. On screen are shape sizes converted to screen pixels by this formula

Koef = 2.65 * 96/Actual DPI
Pixels on Screen = Size in MM / koef

Constant 2.65 is determined by TDM developer team of historical reasons.

When we talk about printer there is necessary convert model size to printer pixels precisely. So it is necessary to use windows API method GetDeviceCaps to determine convert ratio and it is for each device different.

Be aware that TDM is not graphical tool as Autocad or similar, where is necessary exactly sizes. More important for us is to have clear diagram with good readability.

Regards
Petr

Hi,

Thank you very much for the detailed explanation. I think I can live with my current implementation.
Background of my question was the fact that I print my workspaces in PDF files so that they can be used as documentation for parts of the data model. I noticed that the stamp I had placed in the lower right corner of the workspace was partially cut off at the right and bottom.
Therefore my idea was to include the pen width in the calculation of the position.
Now I simply subtract 1 from the X and Y position.

BR
Dirk