[Frage] Z-Wert der Koordinatenliste die an Polyline3D übergeben wird um Faktor 1000 zu klein, warum? [Gelöst]

Schlagworte:
  • Visual
  • Script
  • Polyline3D
  • Z-Koordinate

Aus einer .csv Datei werden Wertepaare von 3D Linien ausgelesen und als Liste an die Node Polyline3D übergeben, diese soll dann die 3D-Linien erstellen. Das funktioniert soweit, nur sind die Z-Werte der 3D-Linien immer um den Faktor 1000 zu klein (die Werte in den Klammern wären korrekt z.B. 455.6 --> gezeichnet wird aber 0.456). Ist dieses Verhalten so normal oder hängt das allenfalls mit den grossen X- und Y-Koordinaten zusammen?

Pairs of 3D lines values are read from a .csv file and passed as a list to the Polyline3D node, which is supposed to create the 3D lines. This works so far, but the Z-values of the 3D lines are always too small by a factor of 1000 (the values in parentheses would be correct, e.g., 455.6 --> but 0.456 is drawn). Is this behavior normal, or could it be related to the large X and Y coordinates?

Anhänge (1)

Typ: image/png
84-mal heruntergeladen
Größe: 37,98 KiB

Lösung anzeigen Lösung verbergen

Gesagt ...getan.
Anbei das erweiterte Node "NodeReadDGMPoints".
Damit ist diese Aufgabe mit 2 Nodes zu lösen. (s. read_dgm_points.png)

NodeReadDGMPoints.zip bitte entpacekn nach \Std\VisualScripts
CSV_Import.zip bitte entpacken nach \Std\Library\VisualScripting

Anhänge (3)

Typ: image/png
35-mal heruntergeladen
Größe: 98,42 KiB
Typ: application/zip
283-mal heruntergeladen
Größe: 3,82 KiB
Typ: application/zip
286-mal heruntergeladen
Größe: 6,80 KiB

The "native" dimension of Allplan and Visual Scripting is Millimeter!

This means that the coordinate values from the csv file must first be multiplied by 1000,
if the values represent meters. This can achived with Node "Operator Multiplication"...

Zitiert von: Nemo
The "native" dimension of Allplan and Visual Scripting is Millimeter!
This means that the coordinate values from the csv file must first be multiplied by 1000,
if the values represent meters. This can achived with Node "Operator Multiplication"...

Hi nemo
thank you for your reply. I did that step with the multiplier before, but this resulted in very strange x and y values.

I added the script and the .csv file to the attachments. I may be using the multiplier in a wrong way?

Anhänge (3)

Typ: image/png
36-mal heruntergeladen
Größe: 44,13 KiB
Typ: application/x-sqlite3
309-mal heruntergeladen
Größe: 132,00 KiB
Typ: application/zip
295-mal heruntergeladen
Größe: 328,00 B

All depends on the content of the csv-file!

As I see it, the values in the .csv file are in meters!

However, the X and Y values are very large, which speaks for "Gauss-Krüger" coordinates or similar.

In order not to get problems with large corrdians in Allplan, you should move these X/Y values
“to the origin”. This can be achieved by subtracting 2672170 m from each of the X values and 1210330 m from each of the Y values. These two values should then be entered in the project offset in order to obtain the original coordinates again when exporting to a DWG file.

Anhänge (1)

Typ: image/png
25-mal heruntergeladen
Größe: 14,44 KiB

Zitiert von: Nemo
All depends on the content of the csv-file!
As I see it, the values in the .csv file are in meters!
However, the X and Y values are very large, which speaks for "Gauss-Krüger" coordinates or similar.
In order not to get problems with large corrdians in Allplan, you should move these X/Y values
“to the origin”. This can be achieved by subtracting 2672170 m from each of the X values and 1210330 m from each of the Y values. These two values should then be entered in the project offset in order to obtain the original coordinates again when exporting to a DWG file.

In fact the project already has an offset of X: 2669200.0000 and Y: 1210200.0000, Z-offset is set to 0.0000. Goal of the script is to import the 3D-lines and then import it as breaklines to ROAD via the road function import breakline. Together with the responding 3D-Points (startpoints and endpoints of the breaklines).

Anhänge (1)

Typ: image/png
4-mal heruntergeladen
Größe: 6,35 KiB

Really now? You didn't think of that yourself?
I would add offset values for X and Y to the script and then subtract these from the coordinate values.
If you then enter the set offset values (X=2669200.0000, Y=1210200.0000), the csv points are imported to the correct position.

Anhänge (2)

Typ: image/png
72-mal heruntergeladen
Größe: 142,78 KiB
Typ: application/zip
328-mal heruntergeladen
Größe: 9,22 KiB

Thank you Nemo for your support.
The script now works as expected. Since it's my first Allplan visual script, I'm sure I can still learn a lot here.

@Allplan

Der Node "ReadPoints" sollte mit folgenden Parametern ergänzt werden:
- "Faktor" (Standard = 1000.0) , da in den meisten Fällen die Koordinaten-Werte in "m" im csv enthalten sind
- "Offset X/Y/Z" mit den Werten des eingestellten Projekt-Offsets als Vorschlagswert

Dann könnte man sich die "Mimik" aus den 7-8 Nodes hinterher sparen.

Edit: Gesagt ...getan.
Anbei das erweiterte Node "NodeReadDGMPoints".
Damit ist diese Aufgabe mit 2 Nodes zu lösen. (s. read_dgm_points.png)

NodeReadDGMPoints.zip bitte entpacekn nach \Std\VisualScripts
CSV_Import.zip bitte entpacken nach \Std\Library\VisualScripting

Anhänge (3)

Typ: image/png
16-mal heruntergeladen
Größe: 98,42 KiB
Typ: application/zip
285-mal heruntergeladen
Größe: 3,82 KiB
Typ: application/zip
284-mal heruntergeladen
Größe: 6,80 KiB

Gesagt ...getan.
Anbei das erweiterte Node "NodeReadDGMPoints".
Damit ist diese Aufgabe mit 2 Nodes zu lösen. (s. read_dgm_points.png)

NodeReadDGMPoints.zip bitte entpacekn nach \Std\VisualScripts
CSV_Import.zip bitte entpacken nach \Std\Library\VisualScripting

Anhänge (3)

Typ: image/png
35-mal heruntergeladen
Größe: 98,42 KiB
Typ: application/zip
283-mal heruntergeladen
Größe: 3,82 KiB
Typ: application/zip
286-mal heruntergeladen
Größe: 6,80 KiB

Perfekt Nemo

Vielen Dank, das ist ja nun wirklich sehr kompakt so.