Skip to content

Commit

Permalink
[TD]support Horiz/Vert Dims in Dxf export
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jan 23, 2020
1 parent 7b90489 commit 91f91f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mod/TechDraw/App/AppTechDrawPy.cpp
Expand Up @@ -644,6 +644,7 @@ class Module : public Py::ExtensionModule<Module>
float gap = 5.0; //hack. don't know font size here.
layerName = dvd->getNameInDocument();
writer.setLayerName(layerName);
int type = 0; //Aligned/Distance
if ( dvd->Type.isValue("Distance") ||
dvd->Type.isValue("DistanceX") ||
dvd->Type.isValue("DistanceY") ) {
Expand All @@ -658,7 +659,12 @@ class Module : public Py::ExtensionModule<Module>
Base::Vector3d(parentX,parentY,0.0);
Base::Vector3d extLine2Start = Base::Vector3d(pts.second.x, -pts.second.y, 0.0) +
Base::Vector3d(parentX,parentY,0.0);
writer.exportLinearDim(textLocn, lineLocn, extLine1Start, extLine2Start, dimText);
if (dvd->Type.isValue("DistanceX") ) {
type = 1;
} else if (dvd->Type.isValue("DistanceY") ) {
type = 2;
}
writer.exportLinearDim(textLocn, lineLocn, extLine1Start, extLine2Start, dimText, type);
} else if (dvd->Type.isValue("Angle")) {
Base::Vector3d textLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY, 0.0);
Base::Vector3d lineLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY,0.0);
Expand Down

0 comments on commit 91f91f4

Please sign in to comment.