Page 1 of 1

extrusion direction

Posted: Tue Aug 19, 2008 7:13 pm
by wwinthan
Hi,
I'm wondering there is a way to get the direction(extrusion) for each circle. I can see those in dxf file itself. but when i use dxflib, i can't find where it stores those information.
also regarding with rotated dimension, i can't differentiate between the dimension block and other block.
thx
winthan

Posted: Wed Aug 20, 2008 2:48 pm
by andrew
Extrusion information is available as member variable 'extrusion' of the DL_CreationInterface. See also class DL_Extrusion in file dl_extrusion.h.

Posted: Wed Aug 20, 2008 2:52 pm
by andrew
Dimensions are stored in DXF as dimension entities.

Autocad stores dimensions also as redundant blocks with names starting with * (asterisk) if I remember correctly.

Posted: Wed Aug 20, 2008 2:54 pm
by wwinthan
could you plz tell me the right one? That extrusion doesn't give me anything. that one is empty. there should have a method or sth that will retrieve that extrusion somewhere in the dxfobject->m_geom->m_circles->sthelse<<< but i can't find that method. could you plz tell me to get the extrusion for each components (circle,arc,line,etc)
thanks

Posted: Wed Aug 20, 2008 2:56 pm
by wwinthan
also how you deal with the(rotated,angular) dimension,etc. the arrows is missing. i have the arrow size but i don't know how to decide the size of arrow and how to reconstruct it. cuz there are many types. could you plz give me a hint on how to do it?also leader doesn't come as part of the m_geometry components. where can i find that also?

thanks

Posted: Wed Aug 20, 2008 3:00 pm
by andrew
wwinthan: dxflib does not contain or work with any such variables (dxfobject, m_geom, m_circles). Are you sure that you are in the right forum? Are you using dxflib to parse your DXF files?

Posted: Wed Aug 20, 2008 3:08 pm
by wwinthan
sry... dxfobject is my own name. it is equal to object of DXF_raw_container.
DXF_raw_container->>>GeoPrimitives m_Geometry;
vector<Block> m_Blocks;

m_geometry members are
vector<DL_PointData> m_Points;
vector<DL_LineData> m_Lines;
vector<DL_ArcData> m_Arcs;
vector<DL_CircleData> m_Circles;
m_Circles doesn't have the functions to get the extrusion (or direction) but i can find those in dxf by opening dxf in notepad
thanks
also I found the dimension block which starts with *D
how you retrieve the arrows coordinates by using dxflib?
or do we need to reconstruct it? i know the arrow size but i don't know how to reconstruct it and put it on the top of the line which accepts arrow
thanks

Posted: Wed Aug 20, 2008 3:11 pm
by wwinthan
I tried the way you told me to deal with rotated dimension(arrow). I can get the parts of rotated dimension(except arrow). I think the arrow is the template or sth cuz somewhere in my dwf it gets printed but only one time eventhough there are multiple rotated dimension. if the arrow is template, it can be reused and some how inserted to the head of the line.
Code
//////////////////////////////////////
AcDbDimension
2
*D65 (<< block name, I went to that block)
10
-0.9673448875724 <<<Type of Arrow (Arrow style)
100
AcDbAlignedDimension
13
-3.729322380762296 << Again i don't understand
Insertion point for clones of a dimension—Baseline and Continue (in
OCS)
23
1.540416037491983
//////////////////////////////*D65 block/////////////////

AcDbBlockBegin
2
*D65
70
1
10
0.0
20
0.0
30
0.0
3
*D65
1

0
LINE
5
86C
330
86B
100
AcDbEntity
8
0
62
0
370
-2
100
AcDbLine
10
-3.666822380762296
20
1.540416037491983
30
0.0
11
-0.9448448875724004
21
1.540416037491982
31
0.0
0
LINE
5
86D
330
86B
100
AcDbEntity
8
0
62
0
370
-2
100
AcDbLine
10
-3.80451627460607
20
1.265184284338577
30
0.0
11
-0.9448448875724004
21
1.265184284338576
31
0.0
0
LINE
5
86E
330
86B
100
AcDbEntity
8
0
62
0
370
-2
100
AcDbLine
10
-0.9673448875724
20
1.720416037491982
30
0.0
11
-0.9673448875724
21
1.900416037491982
31
//////////////////
the lines in the above block are the parts of rotated dimension. I didn't see the coordinates that will make the arrows. Could you plz help me out by doing some research on it? sorry for disturbing you again and again.




could you plz go to
http://discussion.autodesk.com/thread.j ... dID=686636
it has the dxf and converted-to-dwf file
thanks

Posted: Wed Aug 20, 2008 3:15 pm
by andrew
You can access extrusion information through the member variable 'extrusion' of DL_CreationInterface.

E.g.:

<code>
void MyCreationInterfaceImplementation::addCircle(const DL_CircleData& data) {
double dir[3];
extrusion->getDirection(dir);
double extrusion = extrusion->getElevation();
...
}
</code>

Posted: Wed Aug 20, 2008 3:17 pm
by andrew
For detailed information about the DXF format and a description of the values that are stored for each entity you will have to refer to the DXF reference documentation at:
http://www.autodesk.com/techpubs/autoca ... /index.htm

Posted: Wed Aug 20, 2008 3:21 pm
by wwinthan
ya. i look throught that reference. but i can't find any information about reconstructing arrows or coordinates of arrows. could you help me out by telling me ur experience on retrieving arrows for rotated dimension.
thanks

Posted: Wed Aug 20, 2008 3:32 pm
by wwinthan
for (i=0;i<shape->m_Geometry.m_Circles.size();i++)
{
DL_Extrusion *extrusion = shape->getExtrusion();

double dir[3];
extrusion->getDirection(dir);

//double *direction=extrusion->getDirection(
double xcenter;
if (dir[2] == -1)
xcenter = shape->m_Geometry.m_Circles.cx*(-1);
else
xcenter =shape->m_Geometry.m_Circles.cx;

DXF_Raw_Container = m_dxfobject
Geoprimitive = m_geometry
for some reason, dir should not return.it's always [0,0,0]

Posted: Wed Aug 20, 2008 3:37 pm
by wwinthan
you are right about extrusion. it's my bad. sry.

Posted: Wed Aug 20, 2008 5:43 pm
by andrew
Please post the same question only once, in one forum. I've removed your redundant post. It also helps to keep different topics in separate forum topics.