Login  Register

Re: check if it's really a 3D point

Posted by perepujal on Feb 28, 2021; 11:17pm
URL: https://forum.librecad.org/check-if-it-s-really-a-3D-point-tp5720281p5720293.html

Well, in the doubt, I've just looked at the asciifile plugin sources and found that the code suposed to store the 3D value in the point is commented out.
See https://github.com/LibreCAD/LibreCAD/blame/master/plugins/asciifile/asciifile.cpp#L443
So I guess you can't get the Z value from the point itself :(

Later I imagined a way to extract the Z value from the string contents of the elevation values:
If when importing the ascii file you tell the plugin to store the elevation as text and if later the list entities plugin outputs the text point insertion and the text string of the elevation, then with some modification of the script you provide on the other thread you could correlate them to the corresponding point.

The problem is that the list entities plugin doesn't output currently those values, so here is a patch for it, I don't know if that would be useful, anyway hope this helps.


diff --git a/plugins/list/list.cpp b/plugins/list/list.cpp
index e585afee..b770352f 100644
--- a/plugins/list/list.cpp
+++ b/plugins/list/list.cpp
@@ -177,6 +177,10 @@ QString LC_List::getStrData(Plug_Entity *ent) {
         break;
     case DPI::TEXT:
         strData.prepend( strEntity.arg(tr("TEXT")));
+       strData.append( strSpecificXY.arg(tr("in point")).
+                        arg(d->realToStr(data.value(DPI::STARTX).toDouble())).
+                        arg(d->realToStr(data.value(DPI::STARTY).toDouble())));
+       strData.append(strSpecific.arg(tr("TEXTCONTENT")).arg(data.value(DPI::TEXTCONTENT).toString()));
         break;
     case DPI::INSERT:
         strData.prepend( strEntity.arg(tr("INSERT")));