[Вопрос] Z-Wert der Koordinatenliste die an Polyline3D übergeben wird um Faktor 1000 zu klein, warum? [Решен]

Теги:
  • 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?

Вложения (1)

Type: image/png
Загружено 84 раз
Size: 37,98 KiB

Show solution Hide solution

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

Вложения (3)

Type: image/png
Загружено 35 раз
Size: 98,42 KiB
Type: application/zip
Загружено 210 раз
Size: 3,82 KiB
Type: application/zip
Загружено 213 раз
Size: 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"...

Цитируется из: 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?

Вложения (3)

Type: image/png
Загружено 36 раз
Size: 44,13 KiB
Type: application/x-sqlite3
Загружено 243 раз
Size: 132,00 KiB
Type: application/zip
Загружено 222 раз
Size: 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.

Вложения (1)

Type: image/png
Загружено 25 раз
Size: 14,44 KiB

Цитируется из: 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).

Вложения (1)

Type: image/png
Загружено 4 раз
Size: 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.

Вложения (2)

Type: image/png
Загружено 72 раз
Size: 142,78 KiB
Type: application/zip
Загружено 249 раз
Size: 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

Вложения (3)

Type: image/png
Загружено 16 раз
Size: 98,42 KiB
Type: application/zip
Загружено 216 раз
Size: 3,82 KiB
Type: application/zip
Загружено 214 раз
Size: 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

Вложения (3)

Type: image/png
Загружено 35 раз
Size: 98,42 KiB
Type: application/zip
Загружено 210 раз
Size: 3,82 KiB
Type: application/zip
Загружено 213 раз
Size: 6,80 KiB

Perfekt Nemo

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