From e2e1617c74f8a058bd24b1e1b20ef27b5fb312d5 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Wed, 30 May 2018 19:36:46 -0400 Subject: [PATCH] Add 999 Application group code - also remove variable $MAXACTVP - not valid in some appls. --- src/Mod/Import/App/dxf.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Mod/Import/App/dxf.cpp b/src/Mod/Import/App/dxf.cpp index 4b63266e6b..a6f29284c4 100644 --- a/src/Mod/Import/App/dxf.cpp +++ b/src/Mod/Import/App/dxf.cpp @@ -4,6 +4,7 @@ // modified 2018 wandererfan #include "PreCompiled.h" +#include #include "dxf.h" using namespace std; @@ -23,8 +24,14 @@ CDxfWrite::CDxfWrite(const char* filepath) return; } m_ofs->imbue(std::locale("C")); + + std::stringstream ss; + ss << "FreeCAD v" << FCVersionMajor << "." << FCVersionMinor << " " << FCRevision; //header & version + (*m_ofs) << "999" << endl; + (*m_ofs) << ss.str() << endl; + (*m_ofs) << " 0" << endl; (*m_ofs) << "SECTION" << endl; (*m_ofs) << " 2" << endl; @@ -65,10 +72,10 @@ CDxfWrite::CDxfWrite(const char* filepath) (*m_ofs) << "$MEASUREMENT" << endl; (*m_ofs) << " 70" << endl; (*m_ofs) << "1" << endl; - (*m_ofs) << " 9" << endl; - (*m_ofs) << "$MAXACTVP" << endl; - (*m_ofs) << " 70" << endl; - (*m_ofs) << "1" << endl; +// (*m_ofs) << " 9" << endl; //not valid in DraftSight +// (*m_ofs) << "$MAXACTVP" << endl; +// (*m_ofs) << " 70" << endl; +// (*m_ofs) << "1" << endl; (*m_ofs) << " 9" << endl; (*m_ofs) << "$LIMMAX" << endl; (*m_ofs) << " 10" << endl; @@ -496,6 +503,10 @@ void CDxfWrite::WriteLinearDim(const double* textMidPoint, const double* lineDef (*m_ofs) << extLine2[2] << endl; writeDimBlock(layer_name); + //three Lines + // extLine2 -> lineDefPoint + // extLine1 -> (extLine1 + (lineDefPoint - extLine2))) + //lineDefPoint -> (extLine1 + (lineDefPoint - extLine2))) } //*************************** @@ -704,6 +715,7 @@ void CDxfWrite::writeDimBlock(const char* layer_name) m_ssBlock << "" << endl; m_ssBlock << " 0" << endl; m_ssBlock << "ENDBLK" << endl; + //TODO: add extension, dimension line endpoints } //***************************