How do I read drawing extents

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

Moderator: andrew

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

How do I read drawing extents

Post by 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

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Post by 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.

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

Post by 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

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Post by andrew » Thu Nov 11, 2010 9:00 am

For $LIMMIN / $LIMMAX you are not looking for a string but vector (setVariableVector).

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

Post by 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);

}

Post Reply

Return to “dxflib 'How Do I' Questions”