extrusion direction

Please use this forum to post feedback and suggestions related to dxflib.

Moderator: andrew

extrusion direction

Postby wwinthan » Tue Aug 19, 2008 7:13 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby andrew » Wed Aug 20, 2008 2:48 pm

Extrusion information is available as member variable 'extrusion' of the DL_CreationInterface. See also class DL_Extrusion in file dl_extrusion.h.
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Postby andrew » Wed Aug 20, 2008 2:52 pm

Dimensions are stored in DXF as dimension entities.

Autocad stores dimensions also as redundant blocks with names starting with * (asterisk) if I remember correctly.
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Postby wwinthan » Wed Aug 20, 2008 2:54 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby wwinthan » Wed Aug 20, 2008 2:56 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby andrew » Wed Aug 20, 2008 3:00 pm

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?
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Postby wwinthan » Wed Aug 20, 2008 3:08 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby wwinthan » Wed Aug 20, 2008 3:11 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby andrew » Wed Aug 20, 2008 3:15 pm

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>
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Postby andrew » Wed Aug 20, 2008 3:17 pm

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
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Postby wwinthan » Wed Aug 20, 2008 3:21 pm

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
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby wwinthan » Wed Aug 20, 2008 3:32 pm

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[i].cx*(-1);
else
xcenter =shape->m_Geometry.m_Circles[i].cx;

DXF_Raw_Container = m_dxfobject
Geoprimitive = m_geometry
for some reason, dir should not return.it's always [0,0,0]
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby wwinthan » Wed Aug 20, 2008 3:37 pm

you are right about extrusion. it's my bad. sry.
wwinthan
Junior Member
 
Posts: 16
Joined: Thu Aug 14, 2008 4:59 pm

Postby andrew » Wed Aug 20, 2008 5:43 pm

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.
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am


Return to dxflib Suggestions and Feedback

Who is online

Users browsing this forum: No registered users and 0 guests