News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu

import data points xyz

Started by Ruedi, December 12, 2020, 07:09:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ruedi

I'm using TC Pro Platinum 2020. I used the ruby console to import data points with earlier versions so far, but  am unable now to do it.
It seems to me that the ruby scripts I have used so far for have disappeared with this tc version.

Anyway I really wonder that there's no simple tool within turbocad itself allowing to import data points, e.g. from a csv file.

Any ideas how to do it?
A short guide how to use the "new" ruby console in tc 20 and where to find e.g. the xyz import ruby script within tc 20 are highly appreciated.

Alvin Gregorio

Quote from: Ruedi on December 12, 2020, 07:09:57 AM
I'm using TC Pro Platinum 2020. I used the ruby console to import data points with earlier versions so far, but  am unable now to do it.
It seems to me that the ruby scripts I have used so far for have disappeared with this tc version.

Anyway I really wonder that there's no simple tool within turbocad itself allowing to import data points, e.g. from a csv file.

Any ideas how to do it?
A short guide how to use the "new" ruby console in tc 20 and where to find e.g. the xyz import ruby script within tc 20 are highly appreciated.

Check out the Terrain Tool, in the Architectural section.  The "Import Terrain" tool/option.

It can be used for other things, it doesn't have to be Architectural or dirt specific.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#2
Another Tool for a workaround:

The 3D_Mesh Tool, found with all the other 3D Tools (Box, Cone, Extrude, etc.)

After having inserted a 3D_Mesh, we can Select it, go into its Table of Vertices, and-- having Copied text from another application, such as in Excel-- highlight the entries in the Table of Vertices and use Ctrl+V to Paste.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Ruedi on December 12, 2020, 07:09:57 AM
I'm using TC Pro Platinum 2020. I used the ruby console to import data points with earlier versions so far, but  am unable now to do it.
It seems to me that the ruby scripts I have used so far for have disappeared with this tc version.

Anyway I really wonder that there's no simple tool within turbocad itself allowing to import data points, e.g. from a csv file.

Any ideas how to do it?
A short guide how to use the "new" ruby console in tc 20 and where to find e.g. the xyz import ruby script within tc 20 are highly appreciated.

Can you provide us with a sample .txt, .csv, or .xyz file that you would like to import into TurboCAD.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Dean

Quote from: Ruedi on December 12, 2020, 07:09:57 AM
I'm using TC Pro Platinum 2020. I used the ruby console to import data points with earlier versions so far, but  am unable now to do it.
It seems to me that the ruby scripts I have used so far for have disappeared with this tc version.

Anyway I really wonder that there's no simple tool within turbocad itself allowing to import data points, e.g. from a csv file.

Any ideas how to do it?
A short guide how to use the "new" ruby console in tc 20 and where to find e.g. the xyz import ruby script within tc 20 are highly appreciated.

Hi,
in the Ruby command console type in import_XYZ_points  then hit enter.
A window will pop up for location of the csv file.

If that doesn't work then a ruby yscript directory is missing.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

nikkipollard

#5
I don't know if this will work in newer versions
If you have excel, you can use a macro to work with coordinates in the active drawing TC.
Something like this.
You just need to add a reference to  turbocad
C:\Program Files\IMSIDesign\TCWP2017\Program64\imsigx24.dll  - your version equivalent


'draw a polyline in TC using selected range of coordinates
Dim TCApp As IMSIGX.Application
Dim TCdraw As IMSIGX.Drawing
Set TCApp = IMSIGX.Application
Set TCdraw = TCApp.ActiveDrawing


If TypeName(Selection) = "Range" Then
Dim rng As Range

Set rng = Selection

Dim num As Integer
num = Selection.Rows.Count
Dim cnum As Integer

cnum = Selection.Columns.Count
On Error Resume Next
Dim poly As IMSIGX.Graphic
Dim x1 As Double
Dim y1 As Double
Dim z1 As Double
   
    x1 = rng.Cells(1, 1).Value
    y1 = rng.Cells(1, 2).Value

If cnum = 2 Then
    z1 = 0
Else
    z1 = rng.Cells(1, 2).Value
End If

Set poly = TCdraw.Graphics.AddLineMultiline(x1, y1, z1)
Dim verts As IMSIGX.Vertices
Set verts = poly.Vertices
Dim VX As IMSIGX.Vertex

Dim i As Integer

For i = 2 To num

    x1 = rng.Cells(i, 1).Value
    y1 = rng.Cells(i, 2).Value

If cnum = 2 Then
    z1 = 0
Else
    z1 = rng.Cells(i, 3).Value
End If

Set VX = verts.add(x1, y1, z1)

Next

poly.Draw
MsgBox ("Done")

Else

MsgBox "Please select a range of coordinates in excel"

End If

End Sub

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Attached is my latest effort, using TurboCAD's Architectural Import Terrain feature.
Also attached is the .xyz (.txt, but I think one could simply change the extension) file from which the Import Terrain was done.
Couldn't get the aft-- if that's what the rear flat piece is termed; I think because it had no angle, in relation to the World Workplane Z axis.

One could Explode this Terrain once or twice, then do whatever they want with it.  Or one could simply use the endpoints to snap to, to create what they want to create.

Note:  After having inserted the Import Terrain, I immediately selected it and changed the Smooth Quality to 0, and switched off the "Show isolines".
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Henry Hubich

Today's trivial update: The rear flat piece is the transom.

Henry H

murray dickinson

#8
Since V2016, TC's had point cloud import (tools|pointcloud), one of its formats is .xyz, like .csv a simple delimited list of x,y,z coordinates.  Just change the file attachment.  Doesn't answer whatever issues you're having with Ruby, but default simple format point import is there. 

Torfinn

Open v 20, and Ruby is still there
What i find is that i have to use point and lines every second time to make it work, and filetype should be  *.xyz

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB