Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, September 23, 2010 6:11:20 AM(UTC)
Steve Saban

Groups: Registered
Posts: 1


Hello, I am evaluating LEADTOOLS 17 and loading some DXF files. Neither the GetUnits command nor the FileInfo structure used to load the file gives the correct units information. They both return the Units as pixels through the DXF file shows the INSUNITS field as inches.

Is there something that I am missing?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, September 26, 2010 6:04:25 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

If you are referring to our L_VecGetUnit() function, this will return the global unit being used in our vector toolkit. It does not represent the units of any particular file.

If you want the units in the drawing to be in inches after it's loaded into LEADTOOLS, you can specify that using the L_VecSetUnit() function.

Currently, there is no way in LEADTOOLS to query a DXF file to find what units are stored in it.
 
#3 Posted : Monday, October 18, 2010 4:22:54 AM(UTC)
licensemgr

Groups: Registered
Posts: 1


<BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/SupportPortal/CS/Themes/default/images/icon-quote.gif">&nbsp;<strong>Steve Saban wrote:</strong></td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4">Hello, I am evaluating LEADTOOLS 17 and loading some DXF files. Neither the GetUnits command nor the FileInfo structure used to load the file gives the correct units information. They both return the Units as pixels through the DXF file shows the INSUNITS field as inches. Is there something that I am missing?</td></tr></table></td></tr></table></BLOCKQUOTE>

Steven,

I recently had this same question myself and took me some time to figure it out.

The $INSUNITS variable is not related to the unit of the CAD file as I also had originally thought; come to find out, in a technical sense, DXF and DWG files are unitless in nature. $INSUNITS relates to a default scale for blocks/inserts placed on the sketch, or, to quote some documentation:

"Specifies a drawing-units value for automatic scaling of blocks, images, or xrefs inserted or attached to a drawing."

The default unit for a newly created VECTORHANDLE is VECTOR_UNIT_PIXELS so unless you specifically change it yourself, that's what you will always get back. The only reason I have found to change it myself was so that calls to L_VecConvertPointToUnit would work, as it converts from the VECTORHANDLE's unit to the passed unit.

If, judging by your original post, you are trying to find the unit value of a DXF file, the answer is you'll have to ask the creator of the particular file, as there is no value for it in the DXF.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.085 seconds.