Page 1 of 1

How do I read drawing extents

Posted: Wed Nov 10, 2010 2:51 pm
by dgp
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

Posted: Wed Nov 10, 2010 8:39 pm
by andrew
The DXF parser calls the setVariableVector, setVariableString, setVariableInt or setVariableDouble functions of your DL_CreationInterface implementation for each such header variable that is found.

Posted: Thu Nov 11, 2010 6:34 am
by dgp
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

Posted: Thu Nov 11, 2010 9:00 am
by andrew
For $LIMMIN / $LIMMAX you are not looking for a string but vector (setVariableVector).

Posted: Thu Nov 11, 2010 10:30 am
by dgp
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);

}