How do I read drawing extents

Use this forum to ask questions about how to do things in dxflib.

Moderator: andrew

How do I read drawing extents

Postby dgp » Wed Nov 10, 2010 2:51 pm

Hi,I have a dxf file with the below extents in the header section.
How do I read them using dxflib ?

$LIMMIN
10
-122.3180704378
20
47.4300256966
9
$LIMMAX
10
-122.3078004390
20
47.4643399154
dgp
Newbie Member
 
Posts: 4
Joined: Wed Nov 10, 2010 2:46 pm

Postby andrew » Wed Nov 10, 2010 8:39 pm

The DXF parser calls the setVariableVector, setVariableString, setVariableInt or setVariableDouble functions of your DL_CreationInterface implementation for each such header variable that is found.
User avatar
andrew
Site Admin
 
Posts: 2592
Joined: Fri Mar 30, 2007 6:07 am

Postby dgp » Thu Nov 11, 2010 6:34 am

This is my header section in dxf file

0
SECTION
2
HEADER
9
$ACADVER
1
AC1009
9
$LUNITS
70
2
9
$LIMMIN
10
-122.3180704378
20
47.4300256966
9
$LIMMAX
10
-122.3078004390
20
47.4643399154
9
$EXTMIN
10
-122.3180704378
20
47.4300256966
9
$EXTMAX
10
-122.3078004390
20
47.4643399154
999


After using the following function int example dxflib_test shipped with dxflib ,it gives

Key#$ACADVER ,Value#AC1009 , Code# 1

Code: Select all
void Test_CreationClass::setVariableString(const char*key , const char*value, int code)
{

    printf("\n\n\n\t Key#%s ,Value#%s , Code# %d\n",key,value, code
);

   
   
   // printAttributes();

}


Is there a way to get values from $LIMMIN and $LIMMAX
dgp
Newbie Member
 
Posts: 4
Joined: Wed Nov 10, 2010 2:46 pm

Postby andrew » Thu Nov 11, 2010 9:00 am

For $LIMMIN / $LIMMAX you are not looking for a string but vector (setVariableVector).
User avatar
andrew
Site Admin
 
Posts: 2592
Joined: Fri Mar 30, 2007 6:07 am

Postby dgp » Thu Nov 11, 2010 10:30 am

Thank you :D .I got the dxf boundaries now.

Code: Select all
void Test_CreationClass::setVariableVector(const char* key,double v1, double v2, double v3, int code)
{
printf("\n\n\n\t Key#%s ,v1#%f , v2#%f,v3#%f\n",key,v1, v2,v3,code);

}
dgp
Newbie Member
 
Posts: 4
Joined: Wed Nov 10, 2010 2:46 pm


Return to dxflib 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 0 guests