Add support for Dxf Export R14 spec

This commit is contained in:
wandererfan
2018-06-27 12:04:51 -04:00
committed by Yorik van Havre
parent 7eead64bb2
commit 08a3e315ce
24 changed files with 2561 additions and 1348 deletions

View File

@@ -68,6 +68,26 @@ SET(SCL_Resources
)
SOURCE_GROUP("SCL" FILES ${SCL_Resources})
SET(DXF_Plate
blocks10.rub
blocks112.rub
blocks114.rub
classes14.rub
entities0.rub
entities12.rub
entities14.rub
header0.rub
header12.rub
header14.rub
objects14.rub
tables10.rub
tables112.rub
tables114.rub
tables20.rub
tables212.rub
tables214.rub
)
generate_from_xml(StepShapePy)
add_library(Import SHARED ${Import_SRCS})
@@ -82,6 +102,11 @@ fc_target_copy_resource(ImportPy
${CMAKE_BINARY_DIR}/Mod/Import
${SCL_Resources})
fc_target_copy_resource(Import
${CMAKE_SOURCE_DIR}/src/Mod/Import/DxfPlate
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Import/DxfPlate
${DXF_Plate})
SET_BIN_DIR(Import Import /Mod/Import)
SET_PYTHON_PREFIX_SUFFIX(Import)

View File

@@ -327,19 +327,24 @@ point3D gPntTopoint3D(gp_Pnt& p)
}
ImpExpDxfWrite::ImpExpDxfWrite(std::string filepath) :
CDxfWrite(filepath.c_str()),
m_layerName("none")
CDxfWrite(filepath.c_str())
{
setOptionSource("User parameter:BaseApp/Preferences/Mod/Draft");
setOptionSource("User parameter:BaseApp/Preferences/Mod/Import");
setOptions();
}
ImpExpDxfWrite::~ImpExpDxfWrite()
{
}
void ImpExpDxfWrite::setOptions(void)
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str());
optionMaxLength = hGrp->GetFloat("maxsegmentlength",5.0);
optionPolyLine = hGrp->GetBool("DiscretizeEllipses",true);
optionPolyLine = hGrp->GetBool("DiscretizeEllipses",false);
optionExpPoints = hGrp->GetBool("ExportPoints",false);
m_version = hGrp->GetInt("DxfVersionOut",14);
setDataDir(App::Application::getResourceDir() + "Mod/Import/DxfPlate/");
}
void ImpExpDxfWrite::exportShape(const TopoDS_Shape input)
@@ -365,13 +370,21 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input)
gp_Pnt s = adapt.Value(f);
gp_Pnt e = adapt.Value(l);
if (fabs(l-f) > 1.0 && s.SquareDistance(e) < 0.001) {
if (optionPolyLine) {
if ((optionPolyLine) &&
(m_version >= 14) ) {
exportLWPoly(adapt);
} else if ((optionPolyLine) ||
(m_version < 14) ) {
exportPolyline(adapt);
} else {
exportEllipse(adapt);
}
} else {
if (optionPolyLine) {
if ((optionPolyLine) &&
(m_version >= 14) ) {
exportLWPoly(adapt);
} else if ((optionPolyLine) ||
(m_version < 14) ) {
exportPolyline(adapt);
} else {
exportEllipseArc(adapt);
@@ -379,7 +392,11 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input)
}
} else if (adapt.GetType() == GeomAbs_BSplineCurve) {
if (optionPolyLine) {
if ((optionPolyLine) &&
(m_version >= 14) ) {
exportLWPoly(adapt);
} else if ((optionPolyLine) ||
(m_version < 14) ) {
exportPolyline(adapt);
} else {
exportBSpline(adapt);
@@ -408,7 +425,7 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input)
for (auto& p: uniquePts) {
double point[3] = {0,0,0};
gPntToTuple(point, p);
WritePoint(point, getLayerName().c_str());
writePoint(point);
}
}
}
@@ -448,7 +465,7 @@ void ImpExpDxfWrite::exportCircle(BRepAdaptor_Curve c)
double radius = circ.Radius();
WriteCircle(center, radius, getLayerName().c_str());
writeCircle(center, radius);
}
void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve c)
@@ -466,8 +483,8 @@ void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve c)
double rotation = xaxis.AngleWithRef(gp_Dir(0, 1, 0), gp_Dir(0, 0, 1));
//2*M_PI = 6.28319 is invalid(doesn't display in LibreCAD), but 2PI = 6.28318 is valid!
//WriteEllipse(center, major, minor, rotation, 0.0, 2 * M_PI, true, getLayerName().c_str() );
WriteEllipse(center, major, minor, rotation, 0.0, 6.28318, true, getLayerName().c_str() );
//writeEllipse(center, major, minor, rotation, 0.0, 2 * M_PI, true );
writeEllipse(center, major, minor, rotation, 0.0, 6.28318, true );
}
void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve c)
@@ -493,7 +510,7 @@ void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve c)
double a = v3.DotCross(v1,v2);
bool dir = (a < 0) ? true: false;
WriteArc(start, end, center, dir, getLayerName().c_str() );
writeArc(start, end, center, dir );
}
void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve c)
@@ -533,7 +550,7 @@ void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve c)
endAngle = -endAngle;
}
WriteEllipse(center, major, minor, rotation, startAngle, endAngle, endIsCW, getLayerName().c_str());
writeEllipse(center, major, minor, rotation, startAngle, endAngle, endIsCW);
}
void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
@@ -574,6 +591,7 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
sd.flag = spline->IsClosed();
sd.flag += spline->IsPeriodic()*2;
sd.flag += spline->IsRational()*4;
sd.flag += 8; //planar spline
sd.degree = spline->Degree();
sd.control_points = spline->NbPoles();
@@ -584,11 +602,22 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
spline->D0(spline->LastParameter(),p);
sd.endtan = gPntTopoint3D(p);
TColStd_Array1OfReal knotsequence(1,sd.knots);
//next bit is from DrawingExport.cpp (Dan Falk?).
Standard_Integer m = 0;
if (spline->IsPeriodic()) {
m = spline->NbPoles() + 2*spline->Degree() - spline->Multiplicity(1) + 2;
}
else {
for (int i=1; i<= spline->NbKnots(); i++)
m += spline->Multiplicity(i);
}
TColStd_Array1OfReal knotsequence(1,m);
spline->KnotSequence(knotsequence);
for (int i = knotsequence.Lower() ; i <= knotsequence.Upper(); i++) {
sd.knot.push_back(knotsequence(i));
sd.knot.push_back(knotsequence(i));
}
sd.knots = knotsequence.Length();
TColgp_Array1OfPnt poles(1,spline->NbPoles());
spline->Poles(poles);
for (int i = poles.Lower(); i <= poles.Upper(); i++) {
@@ -596,7 +625,7 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
}
//OCC doesn't have separate lists for control points and fit points.
WriteSpline(sd,getLayerName().c_str());
writeSpline(sd);
}
void ImpExpDxfWrite::exportBCurve(BRepAdaptor_Curve c)
@@ -615,7 +644,7 @@ void ImpExpDxfWrite::exportLine(BRepAdaptor_Curve c)
gp_Pnt e = c.Value(l);
double end[3] = {0,0,0};
gPntToTuple(end, e);
WriteLine(start, end, getLayerName().c_str());
writeLine(start, end);
}
void ImpExpDxfWrite::exportLWPoly(BRepAdaptor_Curve c)
@@ -639,7 +668,7 @@ void ImpExpDxfWrite::exportLWPoly(BRepAdaptor_Curve c)
pd.Verts.push_back(gPntTopoint3D(p));
}
pd.nVert = discretizer.NbPoints ();
WriteLWPolyLine(pd,getLayerName().c_str());
writeLWPolyLine(pd);
}
}
@@ -664,7 +693,7 @@ void ImpExpDxfWrite::exportPolyline(BRepAdaptor_Curve c)
pd.Verts.push_back(gPntTopoint3D(p));
}
pd.nVert = discretizer.NbPoints ();
WritePolyline(pd,getLayerName().c_str());
writePolyline(pd);
}
}
@@ -679,7 +708,7 @@ void ImpExpDxfWrite::exportText(const char* text, Base::Vector3d position1, Base
location2[1] = position2.y;
location2[2] = position2.z;
WriteText(text, location1, location2, size, just, getLayerName().c_str());
writeText(text, location1, location2, size, just);
}
void ImpExpDxfWrite::exportLinearDim(Base::Vector3d textLocn, Base::Vector3d lineLocn,
@@ -702,7 +731,7 @@ void ImpExpDxfWrite::exportLinearDim(Base::Vector3d textLocn, Base::Vector3d lin
ext2[0] = extLine2Start.x;
ext2[1] = extLine2Start.y;
ext2[2] = extLine2Start.z;
WriteLinearDim(text, line, ext1,ext2,dimText, getLayerName().c_str());
writeLinearDim(text, line, ext1,ext2,dimText);
}
void ImpExpDxfWrite::exportAngularDim(Base::Vector3d textLocn, Base::Vector3d lineLocn,
@@ -730,7 +759,7 @@ void ImpExpDxfWrite::exportAngularDim(Base::Vector3d textLocn, Base::Vector3d li
apex[0] = apexPoint.x;
apex[1] = apexPoint.y;
apex[2] = apexPoint.z;
WriteAngularDim(text, line, apex, ext1, apex, ext2, dimText, getLayerName().c_str());
writeAngularDim(text, line, apex, ext1, apex, ext2, dimText);
}
void ImpExpDxfWrite::exportRadialDim(Base::Vector3d centerPoint, Base::Vector3d textLocn,
@@ -749,7 +778,7 @@ void ImpExpDxfWrite::exportRadialDim(Base::Vector3d centerPoint, Base::Vector3d
arc[0] = arcPoint.x;
arc[1] = arcPoint.y;
arc[2] = arcPoint.z;
WriteRadialDim(center, text, arc, dimText, getLayerName().c_str());
writeRadialDim(center, text, arc, dimText);
}
@@ -769,5 +798,5 @@ void ImpExpDxfWrite::exportDiametricDim(Base::Vector3d textLocn,
arc2[0] = arcPoint2.x;
arc2[1] = arcPoint2.y;
arc2[2] = arcPoint2.z;
WriteDiametricDim(text, arc1, arc2, dimText, getLayerName().c_str());
writeDiametricDim(text, arc1, arc2, dimText);
}

View File

@@ -73,13 +73,13 @@ namespace Import
{
public:
ImpExpDxfWrite(std::string filepath);
~ImpExpDxfWrite();
void exportShape(const TopoDS_Shape input);
std::string getLayerName() { return m_layerName; }
void setLayerName(std::string s) { m_layerName = s; }
std::string getOptionSource() { return m_optionSource; }
void setOptionSource(std::string s) { m_optionSource = s; }
void setOptions(void);
void exportText(const char* text, Base::Vector3d position1, Base::Vector3d position2, double size, int just);
void exportLinearDim(Base::Vector3d textLocn, Base::Vector3d lineLocn,
Base::Vector3d extLine1Start, Base::Vector3d extLine2Start,
@@ -110,8 +110,7 @@ namespace Import
void exportLWPoly(BRepAdaptor_Curve c); //LWPolyline not supported in R12?
void exportPolyline(BRepAdaptor_Curve c);
std::string m_layerName;
std::string m_optionSource;
// std::string m_optionSource;
double optionMaxLength;
bool optionPolyLine;
bool optionExpPoints;

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,9 @@
// This program is released under the BSD license. See the file COPYING for details.
// modified 2018 wandererfan
#ifndef _dxf_h_
#define _dxf_h_
#pragma once
#include <algorithm>
@@ -17,6 +20,8 @@
#include <string.h>
#include <math.h>
#include <Base/Vector3D.h>
//Following is required to be defined on Ubuntu with OCC 6.3.1
#ifndef HAVE_IOSTREAM
#define HAVE_IOSTREAM
@@ -120,61 +125,115 @@ class CDxfWrite{
private:
std::ofstream* m_ofs;
bool m_fail;
std::stringstream m_ssBlock;
std::ostringstream* m_ssBlock;
std::ostringstream* m_ssBlkRecord;
std::ostringstream* m_ssEntity;
std::ostringstream* m_ssLayer;
protected:
void putLine(const Base::Vector3d s, const Base::Vector3d e,
std::ostringstream* outStream, const std::string handle,
const std::string ownerHandle);
void putText(const char* text, const Base::Vector3d location1, const Base::Vector3d location2,
const double height, const int horizJust,
std::ostringstream* outStream, const std::string handle,
const std::string ownerHandle);
void putArrow(Base::Vector3d arrowPos, Base::Vector3d barb1Pos, Base::Vector3d barb2Pos,
std::ostringstream* outStream, const std::string handle,
const std::string ownerHandle);
//! copy boiler plate file
std::ostringstream getPlateFile(std::string fileSpec);
void setDataDir(std::string s) { m_dataDir = s; }
std::string getEntityHandle(void);
std::string getLayerHandle(void);
std::string getBlockHandle(void);
std::string getBlkRecordHandle(void);
std::string m_optionSource;
int m_version;
int m_entityHandle;
int m_layerHandle;
int m_blockHandle;
int m_blkRecordHandle;
std::string m_saveModelSpaceHandle;
std::string m_savePaperSpaceHandle;
std::string m_saveBlockRecordTableHandle;
std::string m_saveBlkRecordHandle;
std::string m_currentBlock;
std::string m_dataDir;
std::string m_layerName;
std::vector<std::string> m_layerList;
std::vector<std::string> m_blockList;
std::vector<std::string> m_blkRecordList;
public:
CDxfWrite(const char* filepath);
~CDxfWrite();
void init(void);
void endRun(void);
bool Failed(){return m_fail;}
// void setOptions(void);
// bool isVersionValid(int vers);
std::string getLayerName() { return m_layerName; }
void setLayerName(std::string s);
void addBlockName(std::string s, std::string blkRecordHandle);
void WriteLine(const double* s, const double* e, const char* layer_name );
void WritePoint(const double*, const char*);
void WriteArc(const double* s, const double* e, const double* c, bool dir, const char* layer_name );
void WriteEllipse(const double* c, double major_radius, double minor_radius,
double rotation, double start_angle, double end_angle, bool endIsCW,
const char* layer_name);
void WriteCircle(const double* c, double radius, const char* layer_name );
void WriteSpline(SplineDataOut sd, const char* layer_name);
void WriteLWPolyLine(LWPolyDataOut pd, const char* layer_name);
void WritePolyline(LWPolyDataOut pd, const char* layer_name);
void WriteVertex(double x, double y, double z, const char* layer_name);
void WriteText(const char* text, const double* location1, const double* location2,
const double height, const int horizJust, const char* layer_name);
void WriteLinearDim(const double* textMidPoint, const double* lineDefPoint,
void writeLine(const double* s, const double* e);
void writePoint(const double*);
void writeArc(const double* s, const double* e, const double* c, bool dir);
void writeEllipse(const double* c, double major_radius, double minor_radius,
double rotation, double start_angle, double end_angle, bool endIsCW);
void writeCircle(const double* c, double radius );
void writeSpline(SplineDataOut sd);
void writeLWPolyLine(LWPolyDataOut pd);
void writePolyline(LWPolyDataOut pd);
void writeVertex(double x, double y, double z);
void writeText(const char* text, const double* location1, const double* location2,
const double height, const int horizJust);
void writeLinearDim(const double* textMidPoint, const double* lineDefPoint,
const double* extLine1, const double* extLine2,
const char* dimText,
const char* layer_name);
const char* dimText);
void writeLinearDimBlock(const double* textMidPoint, const double* lineDefPoint,
const double* extLine1, const double* extLine2,
const char* dimText);
void WriteAngularDim(const double* textMidPoint, const double* lineDefPoint,
void writeAngularDim(const double* textMidPoint, const double* lineDefPoint,
const double* startExt1, const double* endExt1,
const double* startExt2, const double* endExt2,
const char* dimText,
const char* layer_name);
const char* dimText);
void writeAngularDimBlock(const double* textMidPoint, const double* lineDefPoint,
const double* startExt1, const double* endExt1,
const double* startExt2, const double* endExt2,
const char* dimText);
void WriteRadialDim(const double* centerPoint, const double* textMidPoint,
void writeRadialDim(const double* centerPoint, const double* textMidPoint,
const double* arcPoint,
const char* dimText,
const char* layer_name);
const char* dimText);
void writeRadialDimBlock(const double* centerPoint, const double* textMidPoint,
const double* arcPoint, const char* dimText);
void WriteDiametricDim(const double* textMidPoint,
void writeDiametricDim(const double* textMidPoint,
const double* arcPoint1, const double* arcPoint2,
const char* dimText,
const char* layer_name);
const char* dimText);
void writeDiametricDimBlock(const double* textMidPoint,
const double* arcPoint1, const double* arcPoint2,
const char* dimText);
void writeDimBlockPreamble(const char* layer_name);
void writeDimBlockPreamble();
void writeBlockTrailer(void);
void writeHeaderSection(void);
void writeTablesSection(void);
void writeBlocksSection(void);
void writeEntitiesSection(void);
void writeObjectsSection(void);
void writeClassesSection(void);
void makeLayerTable(void);
void makeBlockRecordTableHead(void);
void makeBlockRecordTableBody(void);
void makeBlockSectionHead(void);
};
// derive a class from this and implement it's virtual functions
@@ -247,3 +306,4 @@ public:
std::string LayerName() const;
};
#endif

View File

@@ -29,4 +29,14 @@ INSTALL(
#${Import_QRC_SRCS}
DESTINATION
Mod/Import
)
)
INSTALL(
DIRECTORY
App/DxfPlate
DESTINATION
${CMAKE_INSTALL_DATADIR}/Mod/Import
FILES_MATCHING
PATTERN "*.rub*"
)

View File

@@ -0,0 +1,24 @@
0
SECTION
2
BLOCKS
0
BLOCK
5
60
2
*MODEL_SPACE
70
0
10
0.0
20
0.0
30
0.0
3
*MODEL_SPACE
1
0
ENDBLK

View File

View File

View File

@@ -0,0 +1,48 @@
0
SECTION
2
CLASSES
0
CLASS
1
ACDBDICTIONARYWDFLT
2
AcDbDictionaryWithDefault
3
ObjectDBX Classes
90
0
280
0
281
0
0
CLASS
1
XRECORD
2
AcDbXrecord
3
ObjectDBX Classes
90
0
280
0
281
0
0
CLASS
1
LWPOLYLINE
2
AcDbPolyline
3
ObjectDBX Classes
90
0
280
0
281
1
0
ENDSEC

View File

@@ -0,0 +1,4 @@
0
SECTION
2
ENTITIES

View File

@@ -0,0 +1,4 @@
0
SECTION
2
ENTITIES

View File

@@ -0,0 +1,4 @@
0
SECTION
2
ENTITIES

View File

@@ -0,0 +1,30 @@
0
SECTION
2
HEADER
9
$DIMSTYLE
2
STANDARD
9
$MEASUREMENT
70
1
9
$TEXTSIZE
40
3.5
9
$TEXTSTYLE
7
STANDARD
9
$DIMTXT
40
3.5
9
$HANDLING
70
0
0
ENDSEC

View File

@@ -0,0 +1,34 @@
0
SECTION
2
HEADER
9
$ACADVER
1
AC1009
9
$DWGCODEPAGE
3
ANSI_1252
9
$TEXTSTYLE
7
STANDARD
9
$DIMSTYLE
2
STANDARD
9
$DIMTXSTY
7
STANDARD
9
$CMLSTYLE
2
STANDARD
9
$HANDLING
70
0
0
ENDSEC

View File

@@ -0,0 +1,38 @@
0
SECTION
2
HEADER
9
$ACADVER
1
AC1014
9
$ACADMAINTVER
70
9
9
$DWGCODEPAGE
3
ANSI_1252
9
$TEXTSTYLE
7
STANDARD
9
$DIMSTYLE
2
STANDARD
9
$DIMTXSTY
7
STANDARD
9
$CMLSTYLE
2
STANDARD
9
$HANDSEED
5
FFF
0
ENDSEC

View File

@@ -0,0 +1,26 @@
0
SECTION
2
OBJECTS
0
DICTIONARY
5
500
330
0
100
AcDbDictionary
3
ACAD_GROUP
350
501
0
DICTIONARY
5
501
330
500
100
AcDbDictionary
0
ENDSEC

View File

@@ -0,0 +1,172 @@
0
SECTION
2
TABLES
0
TABLE
0
VPORT
2
VPORT
5
20
70
0
0
ENDTAB
0
TABLE
0
LTYPE
5
22
2
CONTINUOUS
3
Solid line
70
0
72
65
73
0
40
0.0
0
ENDTAB
0
TABLE
0
STYLE
5
26
2
STANDARD
3
TXT
70
3
5
27
70
0
40
0
41
1
50
0
71
0
42
1
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
55
70
1
0
DIMSTYLE
105
56
2
STANDARD
70
0
40
1
41
0.18
42
0.0625
43
0.38
44
0.18
45
0.0
46
0.0
47
0.0
48
0
49
1
140
0.18
141
0.09
142
0.0
143
25.4
144
1.0
145
0.0
146
1.0
147
0.09
71
0
72
0
73
1
74
1
75
0
76
0
77
0
78
0
170
0
171
2
172
0
173
0
174
0
175
0
176
0
177
0
178
0
0
ENDTAB
0
TABLE
0
LAYER
2
LAYER
5
28
70
1
5
29
2
0
70
0
62
7
6
CONTINUOUS

View File

@@ -0,0 +1,72 @@
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
20
70
1
0
ENDTAB
0
TABLE
2
LTYPE
5
22
70
1
0
LTYPE
5
23
2
BYLAYER
70
0
3
NORMAL
72
65
73
1
40
1
0
ENDTAB
0
TABLE
2
STYLE
5
24
70
1
0
STYLE
5
26
2
STANDARD
3
txt
70
0
40
0
41
1
50
0
71
0
42
1
4
0
ENDTAB

View File

@@ -0,0 +1,112 @@
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
20
330
0
100
AcDbSymbolTable
70
1
0
VPORT
5
21
330
20
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
2
*ACTIVE
70
0
0
ENDTAB
0
TABLE
2
LTYPE
5
22
330
0
100
AcDbSymbolTable
70
1
0
LTYPE
5
23
330
21
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYBLOCK
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
24
330
21
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYLAYER
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
25
330
21
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CONTINUOUS
70
0
3
Solid line
72
65
73
0
40
0.0
0
ENDTAB

View File

@@ -0,0 +1,4 @@
0
ENDTAB
0
ENDSEC

View File

@@ -0,0 +1,142 @@
0
TABLE
2
VIEW
5
50
70
0
0
ENDTAB
0
TABLE
2
UCS
5
51
70
0
0
ENDTAB
0
TABLE
2
APPID
5
52
70
3
0
APPID
5
53
2
ACAD
70
0
0
APPID
5
54
2
FreeCAD
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
55
70
2
0
DIMSTYLE
105
56
2
STANDARD
70
0
3
0
4
0
5
0
6
0
7
0
40
1
41
0.18
42
0.0625
43
0.38
44
0.18
45
0.0
46
0.0
47
0.0
48
0
140
0.18
141
0.09
142
0.0
143
25.4
144
1.0
145
0.0
146
1.0
147
0.09
71
0
72
0
73
1
74
1
75
0
76
0
77
0
78
0
170
0
171
2
172
0
173
0
174
0
175
0
176
0
177
0
178
0
0
ENDTAB

View File

@@ -0,0 +1,278 @@
0
TABLE
2
STYLE
5
60
330
0
100
AcDbSymbolTable
70
2
0
STYLE
5
61
330
60
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
STANDARD
70
0
40
0.0
41
1.0
50
0.0
71
0
42
2.5
3
arial.ttf
4
0
STYLE
5
62
330
60
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
ANNOTATIVE
70
0
40
0.0
41
1.0
50
0.0
71
0
42
2.5
3
arial.ttf
4
0
ENDTAB
0
TABLE
2
VIEW
5
63
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
UCS
5
64
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
APPID
5
65
330
0
100
AcDbSymbolTable
70
2
0
APPID
5
66
330
65
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD
70
0
0
APPID
5
67
330
65
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACADANNOTATIVE
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
68
330
0
100
AcDbSymbolTable
70
2
0
DIMSTYLE
105
69
330
68
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
2
STANDARD
70
0
3
4
5
6
7
40
0.0
41
2.5
42
0.625
43
3.75
44
1.25
45
0.0
46
0.0
47
0.0
48
0.0
140
2.5
141
2.5
142
0.0
143
0.03937007874016
144
1.0
145
0.0
146
1.0
147
0.625
71
0
72
0
73
0
74
0
75
0
76
0
77
1
78
8
170
0
171
3
172
1
173
0
174
0
175
0
176
0
177
0
178
0
270
2
271
2
272
2
273
2
274
3
340
61
275
0
280
0
281
0
282
0
283
0
284
8
285
0
286
0
287
3
288
0
0
ENDTAB

View File

@@ -544,7 +544,7 @@ private:
try {
ImpExpDxfWrite writer(filePath);
writer.setLayerName(layerName);
writer.init();
App::DocumentObject* obj = 0;
TechDraw::DrawViewPart* dvp = 0;
if (PyObject_TypeCheck(viewObj, &(TechDraw::DrawViewPartPy::Type))) {
@@ -555,6 +555,7 @@ private:
writer.setLayerName(layerName);
write1ViewDxf(writer,dvp,align);
}
writer.endRun();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
@@ -577,8 +578,7 @@ private:
try {
ImpExpDxfWrite writer(filePath);
writer.setLayerName(layerName);
writer.init();
App::DocumentObject* obj = 0;
TechDraw::DrawPage* dp = 0;
if (PyObject_TypeCheck(pageObj, &(TechDraw::DrawPagePy::Type))) {
@@ -686,6 +686,7 @@ private:
}
}
}
writer.endRun();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());