News:

Be sure your post is relevant to the current discussion.  Create a new topic within the appropriate board if you are unsure.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Coordinate import or plot

Started by AussieBloke, May 06, 2020, 08:48:23 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

AussieBloke

Unless Ive overlooked something tc cant import coordinate data, it could be that I could import through 1 of tcads file filters but I dont know which one, so heres some data that Id like to test.

I presume that the following coordinates can be drawn by using a polyline/line tool ( assuming these are world coords ) but how can I use this data to navigate and enter it?

CLARK Y AIRFOIL
      61.0      61.0

0.0000000 0.0000000
0.0005000 0.0023390
0.0010000 0.0037271
0.0020000 0.0058025
0.0040000 0.0089238
0.0080000 0.0137350
0.0120000 0.0178581
0.0200000 0.0253735
0.0300000 0.0330215
0.0400000 0.0391283
0.0500000 0.0442753
0.0600000 0.0487571
0.0800000 0.0564308
0.1000000 0.0629981
0.1200000 0.0686204
0.1400000 0.0734360
0.1600000 0.0775707
0.1800000 0.0810687
0.2000000 0.0839202
0.2200000 0.0861433
0.2400000 0.0878308
0.2600000 0.0890840
0.2800000 0.0900016
0.3000000 0.0906804
0.3200000 0.0911857
0.3400000 0.0915079
0.3600000 0.0916266
0.3800000 0.0915212
0.4000000 0.0911712
0.4200000 0.0905657
0.4400000 0.0897175
0.4600000 0.0886427
0.4800000 0.0873572
0.5000000 0.0858772
0.5200000 0.0842145
0.5400000 0.0823712
0.5600000 0.0803480
0.5800000 0.0781451
0.6000000 0.0757633
0.6200000 0.0732055
0.6400000 0.0704822
0.6600000 0.0676046
0.6800000 0.0645843
0.7000000 0.0614329
0.7200000 0.0581599
0.7400000 0.0547675
0.7600000 0.0512565
0.7800000 0.0476281
0.8000000 0.0438836
0.8200000 0.0400245
0.8400000 0.0360536
0.8600000 0.0319740
0.8800000 0.0277891
0.9000000 0.0235025
0.9200000 0.0191156
0.9400000 0.0146239
0.9600000 0.0100232
0.9700000 0.0076868
0.9800000 0.0053335
0.9900000 0.0029690
1.0000000 0.0005993

0.0000000 0.0000000
0.0005000 -.0046700
0.0010000 -.0059418
0.0020000 -.0078113
0.0040000 -.0105126
0.0080000 -.0142862
0.0120000 -.0169733
0.0200000 -.0202723
0.0300000 -.0226056
0.0400000 -.0245211
0.0500000 -.0260452
0.0600000 -.0271277
0.0800000 -.0284595
0.1000000 -.0293786
0.1200000 -.0299633
0.1400000 -.0302404
0.1600000 -.0302546
0.1800000 -.0300490
0.2000000 -.0296656
0.2200000 -.0291445
0.2400000 -.0285181
0.2600000 -.0278164
0.2800000 -.0270696
0.3000000 -.0263079
0.3200000 -.0255565
0.3400000 -.0248176
0.3600000 -.0240870
0.3800000 -.0233606
0.4000000 -.0226341
0.4200000 -.0219042
0.4400000 -.0211708
0.4600000 -.0204353
0.4800000 -.0196986
0.5000000 -.0189619
0.5200000 -.0182262
0.5400000 -.0174914
0.5600000 -.0167572
0.5800000 -.0160232
0.6000000 -.0152893
0.6200000 -.0145551
0.6400000 -.0138207
0.6600000 -.0130862
0.6800000 -.0123515
0.7000000 -.0116169
0.7200000 -.0108823
0.7400000 -.0101478
0.7600000 -.0094133
0.7800000 -.0086788
0.8000000 -.0079443
0.8200000 -.0072098
0.8400000 -.0064753
0.8600000 -.0057408
0.8800000 -.0050063
0.9000000 -.0042718
0.9200000 -.0035373
0.9400000 -.0028028
0.9600000 -.0020683
0.9700000 -.0017011
0.9800000 -.0013339
0.9900000 -.0009666
1.0000000 -.0005993

nikkipollard

look in the sdk section I think I have seen something there.

If not I took a long way around
copied the points into excel
converted the points into a format recognizable by the ppm editor
copied from excel into the ppm editor 
drew a polyline through the points

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

Torfinn

There is a function in Ruby that will import point or line, after run one of them we did need to use the other one before we could use the first one again.
But we need to save the file as a .xyz file to use it there.

But why not use TC Coordinate import
This is what i get if use TC terrain tool for import a txt file, it looks like to be 2 parts so i splitted the file in 2 on the Attached.

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

AussieBloke

Thanks Nikki & Torfinn for the alternate methods.

Tim Stewart

Quote from: nikkipollard on May 06, 2020, 11:02:08 PM
look in the sdk section I think I have seen something there.

If not I took a long way around
copied the points into excel
converted the points into a format recognizable by the ppm editor
copied from excel into the ppm editor 
drew a polyline through the points

Works like a charm!   :)
Regards Tim

You can design without engineering, but you cannot engineer without design.
Windows 10 Pro (19043.1165) 64-bit, TurboCAD Designer 2017-2020 and Pro. Plat. 2018-2020 + LW (64-bit) + AnimationLab 6
Intel i5 2500@3.3GHz 8GB Ram NVIDIA Quadro K2200

murray dickinson

#5
You can do it using the mesh tool, but the mesh doesn't like spacebar as delimiter between the x and y values, spacebar as listed gives a "wrong double value" error message.  So, I copy-pasted the first half of the list into Notepad++, a really good open-source text editor (one of its talents is being able to select columns in text), and recorded a macro of three or four lines of "tab, back arrow, down arrow, tab" between the coordinates to make tab the whitespace and formatted the list with the macro.  Open a new file/tab in Notepad++ to do the same with the other half of the list.  The profile's got 61 coordinates each for topside and underside, so I gave the mesh 61 nodes in x, 2 nodes in y.   Place the mesh any old place, the coordinate list opens, check OK to dismiss it.  Select and copy the coordinates in Notepad++, select the mesh, ctrl + F to open properties, go to the 3D Mesh Shape page, and the table of vertices, drag-select the x and y cells of row 1 and paste the coordinates into it.  Click OK and back out of everything, so you can select and copy the underside coords and repeat the pasting into row 2.  An alternative to reformatting the coordinates in Notepad++ is to use its column-select to copy the x coordinates and paste them into the mesh x column, then Notepad++ column-select the Y coords and paste them into the mesh y column, then do it for the remainder of the coordinates.
That gives you a mesh with the profile shape, explode it twice and it's a polyline outline.
I've been entering coordinates into TC this way since V6.  I admire Nikki's skill with PP scripting, Torfinn's too.  I'm syntax-challenged.

AussieBloke

I havent dloaded yet so thanks Tim for the image and testing and thanks Murray for the work arouund in mesh tools. Yes Im using Notepad++ also 😎


murray dickinson

#7
With a bit of ad hoc external formatting like Nikki did, you can also use the macro recorder to enter coordinate lists like this profile:  Start recording and draw an arbitrary polyline, or spline, with four or five points, then stop recording.  Look down through the recorded macro, you'll see the coordinates listed like this:

   Drag xOrigin + 1.0670421059360757, yOrigin + 0.2525006212718891, zOrigin + 0.0000000000000000, 0
      Click xOrigin + 1.0670421059360757, yOrigin + 0.2525006212718891, zOrigin + 0.0000000000000000, 1
      Drag xOrigin + 1.1699765972564682, yOrigin + 0.1261719273786801, zOrigin + 0.0000000000000000, 0
      Click xOrigin + 1.1699765972564682, yOrigin + 0.1261719273786801, zOrigin + 0.0000000000000000, 1
      Drag xOrigin + 1.1808938917904495, yOrigin + 0.0403931846116862, zOrigin + 0.0000000000000000, 0
      Click xOrigin + 1.1808938917904495, yOrigin + 0.0403931846116862, zOrigin + 0.0000000000000000, 1
      DoLocalMenu 102, 0, xOrigin + 1.1824535052953038, yOrigin + 0.0591085466699394, zOrigin + 0.0000000000000000

With a text editor you can format your own coordinates the same way.   Just note that the last vertex is formatted differently, but you can format the list in a text editor, select and copy/paste over the short vertex list in the macro recorder, run it and you've got your polyline.  I don't know if remember right, but when IMSI released a beta of the symbol creator app, something like a standalone PPM, it was noted that it wouldn't do splines, and the PPM wouldn't either?  Maybe Nikki or Torfinn can confirm or correct me about that, but splines and points can also be plotted in macro recorder the way I describe above.     

nikkipollard

#8
Murray you are right ppm doesn't do splines. The macro recorder would do a better job.
I chose to use excel to change the format of the points instead of a text editor because the formulas make the job easier.
Once you set up the formula for the first point drag it down the column and all the points are changed using the same formula. I guess you could do a similar thing with google sheets.

Just a quick question on the macro recorder.
I formatted the points as per the macro recorder copied and pasted into the macro recorder ran the macro - it worked except I got an extra loop
I presume it is something to do with the syntax
What does DoLocalMenu 102 do? - I had a different number
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

Thanks Nikki.  I don't have Excel, I use LibreOffice, I expect that its cell formula function will work the same way too.  It's always good to get suggestions from others like yours and Torfinn's, none of TC's methods are obvious except for the Ruby "importXYZlines" script, and as for Torfinn revealing that you can't run it repeatedly, it's got to be alternated with the XYZpoints version, well, who knew except for him?!

AussieBloke

Murray & Nikki what versions are you using the macro recorder in, I recently posted to rhe beta forum that the macro recorder is broken in 2018 thru to 2020?

Andy H

Quote from: nikkipollard on May 07, 2020, 09:48:02 PM
What does DoLocalMenu 102 do? - I had a different number

Effectively its the right click menu, although the same applies if you click an inspection bar icon.  the number will differ depending on whether one chooses close or finish.  it also differs depending on mode, i.e. if one chooses Close when drawing a polyline it may be 102, but when node editing a polyline, Close may be 116 or 120 (depending on whether one has 'Selector' turned on).

Note. it can also differ depending on TC version, if commands / icons are added or removed.

Andy H

#12
Could not resist giving it a go in AnimationLab.  Drawback - its temperamental. It broke after a few tries. I obviously got the code wrong.

It uses the following to get the coordinates from a text file.
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set opn = fso.OpenTextFile("C:\My Docs\notepad\foil_data.txt", 1)

  txt = opn.ReadAll   ' gets the data from a text file
  dta  = Split(txt, VbCrLF)  ' splits the text into an array
  opn.Close
  Set fso  = Nothing
  Set opn = Nothing

Andy

Click image below to start animation


murray dickinson

#13
That's very cute, Andy!  Thanks for chiming in with stuff that I don't know about.  Like I said somewhere back, I'm syntax-challenged (but the syntax is different for every tool...grrr) so I bash away at things like one of the proverbial infinite number of monkeys on typewriters in Shakespeare's back room.   I notice that the formatting's different, but it works so my curiosity isn't aroused. 
Daz, PCs are a bit of a passion so I've got quite a few with TC versions with macro recorder back to 10.5 up to 2016.  Waiting for 2020 from turnleft/mindscape, due next week, surprises me that it's not working for two years and nobody's wailing? 

Henry Hubich

Andy, that's fantastic. Can you share foil_data.txt?

Henry H

Andy H

Quote from: Henry Hubich on May 08, 2020, 09:01:37 AM
Andy, that's fantastic. Can you share foil_data.txt?

Henry H

No problem, its basically the same as what Darryl posted, except I removed any leading spaces, which can happen when copying text from a web page.

It has both x and y coordinates.  What I did was use code to separate the x and y data.

i = StepNum ' gets the frame number
frm = dta(i)   ' reads the value for that frame from the array
length = Len(frm) - 10  ' gets the length of the text needed for Y (differs depending on whether there is a minus)
Xnum = Left(frm,9) 'gets the x coordinates (always 9 characters)
If Isnumeric(Xnum) then  ' this just makes sure the text can be converted to numbers
Xnum = Cdbl(Xnum)
End If
Ynum = Right(frm, length) ' gets the characters needs for Y
If Isnumeric(Ynum) then  ' checks if Y results in a number
Ynum = Cdbl(Ynum)
End If

For AnimationLab the values of Xnum, and Ynum, are passed to a AddNode command



Henry Hubich


murray dickinson

What formats can AniLab write to?  Does this create the entity in a TC file, or is it only a graphical object? 

Andy H

Quote from: murray dickinson on May 08, 2020, 10:12:13 PM
What formats can AniLab write to?  Does this create the entity in a TC file, or is it only a graphical object?

AnimationLab will permanently alter the opened TC drawing, if one forgets to use Undo, or Save-As.  In the above example I added the first segment of a polyline, and ALab added all the other segments, (Add node command), It creates the finished polyline (or spline) in basically the same way as manually tabbing to the coordinate fields and typing in the coordinates, pressing return key, then tabbing and entering the next coordinates etc. 

The Gif or AVI is a bit like ALab taking a screenshot after each polyline segment is added. Then adding the screenshot to a movie file.

I think it is possible to create a brand new object from scratch (without the AddNode command), like one would using PPM's. But that requires more knowledge of the SDK than what I have possess.

Ken Simmons

#19
About a week ago I added this to my "Favorite" website: https://m-selig.ae.illinois.edu/ads/coord_database.html. After reading this post, I added to my reply on wish list for TC 2021(under Gen. Discussions). Added some pictures of a TF-102 damaged area as an example of the repairs that we run into. I wonder if there is a way to collect data from contour formers (like ribs on a wing) I do have a 3D scanner but it's not accurate enough, it's an old model that attached to a iPad. Calipers would be my next choice and measure with 1 inch or 25 mm. spacing. But this would be a long process with multiple formers.
TC 2017 Plat. x32 / x64 (LightWorks)
Win 10 Pro 64.
i7-3770 16 GB. Ram.
Nivda GeForce GTX 970 4 GB.

Marek

I modified a bit my old VBnet script for importing points  and could draw splines from the attached data (divided into two parts). I also left points - they can be useful. I do not attach the script because I would have to refine it.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

murray dickinson

Terrain is most tolerant of these methods, then, it'll plot the list as Daz has posted it, copy/pasted into notepad and saved as .txt, but the result is messy with all of the GIS notation stuff attached.  Next easiest are the Ruby ImportXYZlines or points, but both it and the mesh method have to have the list formatted with tab delimiting - which is easy in Notepad++ or a spreadsheet editor as Nikki described.  A small possible benefit of the mesh table is that it can be edited in situ.  Then I think the macro recorder with a bit of formatting, with the advantage of curves and points being doable too, then Nikki's PPM if you know what you're doing with that tool's syntax.  Same for Andy's AniLab capacity, but it's not a native TC tool either, and Marek, yours is exotica.  More than a few ways to do it.
     

Jeff_in_90620

Quote from: nikkipollard on May 06, 2020, 11:02:08 PM
File: [dtest.ppm]

I'm not finding anything useful in TurboCAD's Help files for using this file.  I tried Insert / Parametric Part and clicked on Load parts from file, but this file did not pass the input filter.


Jeff
Jeff

TC 2026 Pro Platinum plus 2015->2024 (most with LightWorks & RedSDK) & V21
System: AMD Ryzen 9 7950X, MSI Mag X670E Tomahawk WiFi, 64GB RAM @ 4.80GHz, ARC A770 w/16GB, 3 x Samsung NVMe 990 (1TB), Windows 11 Pro (64-bit)

Marek

#23
Hi Murray
OK.  ;-) . As you write yourself,  the methods are many. I give as one of the possibilities. I use Notepad ++ very often. This script was written years ago, when the only way to import points to TC was "import terrain", where you must indicate the insertion point. I needed to import points into digital maps, at exact coordinates, with descriptions, etc. I also wrote some scripts in Ruby. I also have my ppm. I am not a programmer and once it's easier for me to do something in Ruby and once in VB. For VB TC has better developed SDK documentation. To now, I use VB scripts, where, for example, I can add different prefixes or different suffixes in 100 different words at once or change a part of a word. TC won't do it and for me it saves  many hours of work on many projects. Sometimes I have such exotic requirements. :D.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Torfinn

Quote from: Jeffin90620 on May 10, 2020, 03:40:06 AM
Quote from: nikkipollard on May 06, 2020, 11:02:08 PM
File: [dtest.ppm]

I'm not finding anything useful in TurboCAD's Help files for using this file.  I tried Insert / Parametric Part and clicked on Load parts from file, but this file did not pass the input filter.


Jeff

There is a difference between PP like you try'd Jeff and PPM.
PPM is a file we normally save to Symbols/ My Symbols folder, and if TC is open we go to Library/ Symbols/ My Symbols and Rigthclick in a free are there, and the Select re-load this category, it then turns up with a ? mark on it, rigthclick on that and Select Update Thumbnails and it will show, that file you have selected you now can click on insert of just drag it in like a Block, and you should be in wireframe to do so

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

Jeff_in_90620

Quote from: Torfinn on May 10, 2020, 05:33:31 AM
There is a difference between PP like you try'd Jeff and PPM.
PPM is a file we normally save to Symbols/ My Symbols folder, and if TC is open we go to Library/ Symbols/ My Symbols and Rigthclick in a free are there, and the Select re-load this category, it then turns up with a ? mark on it, rigthclick on that and Select Update Thumbnails and it will show, that file you have selected you now can click on insert of just drag it in like a Block, and you should be in wireframe to do so

Okay... I'll make a note of this and try it out.


Thanks,

Jeff
Jeff

TC 2026 Pro Platinum plus 2015->2024 (most with LightWorks & RedSDK) & V21
System: AMD Ryzen 9 7950X, MSI Mag X670E Tomahawk WiFi, 64GB RAM @ 4.80GHz, ARC A770 w/16GB, 3 x Samsung NVMe 990 (1TB), Windows 11 Pro (64-bit)

murray dickinson

Quote from: Marek on May 10, 2020, 04:16:26 AM
Hi Murray
OK.  ;-) . As you write yourself,  the methods are many. I give as one of the possibilities. I use Notepad ++ very often. This script was written years ago, when the only way to import points to TC was "import terrain", where you must indicate the insertion point. I needed to import points into digital maps, at exact coordinates, with descriptions, etc. I also wrote some scripts in Ruby. I also have my ppm. I am not a programmer and once it's easier for me to do something in Ruby and once in VB. For VB TC has better developed SDK documentation. To now, I use VB scripts, where, for example, I can add different prefixes or different suffixes in 100 different words at once or change a part of a word. TC won't do it and for me it saves  many hours of work on many projects. Sometimes I have such exotic requirements. :D.
Marek

Marek, you might claim that you're not a programmer, but your body of work says you are.  I look at programming IDEs and I might as well be trying to read hieroglyphics.   I can cut, paste, format somewhat and test in existing scripts but that's my glass ceiling up to now.   I'm envious of everybody who's even a little competent with code. 

nikkipollard

Quote from: Jeffin90620 on May 10, 2020, 03:40:06 AM
Quote from: nikkipollard on May 06, 2020, 11:02:08 PM
File: [dtest.ppm]

I'm not finding anything useful in TurboCAD's Help files for using this file.  I tried Insert / Parametric Part and clicked on Load parts from file, but this file did not pass the input filter.



Jeff
Jeff there is a parametric script editor in TC. It saves files to a ppm format. used for making parametric symbols. similar to Archicads GDL objects. I copied and pasted the modified points from excel directly into the ppm editor . saved it and then ran it.
The thing I like about PPM is , is the fact that the scripting language is very simple and well documented - in comparison to the SDK,
here is a link to the help file

https://turbocaddoc.atlassian.net/wiki/spaces/TG/pages/176982592/Parametric+Part+Script+Editing
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

#28
Last one: I also had success with the "Draw3DLine" Ruby script.  That one doesn't call for a text file of the vertices to look up, it's got a vertex list within the script that's formatted like:

grVerts.Add(12.5, 0.0, 3.5)
  grVerts.Add(12.5, 0.0, 0.0)

so it's simple to format that line prefix, comma delimiter and brackets in Notepad++ or spreadsheet editor around the vertex list and execute. 

Alvin Gregorio

Quote from: nikkipollard on May 11, 2020, 01:38:24 AM
Quote from: Jeffin90620 on May 10, 2020, 03:40:06 AM
Quote from: nikkipollard on May 06, 2020, 11:02:08 PM
File: [dtest.ppm]

I'm not finding anything useful in TurboCAD's Help files for using this file.  I tried Insert / Parametric Part and clicked on Load parts from file, but this file did not pass the input filter.



Jeff
Jeff there is a parametric script editor in TC. It saves files to a ppm format. used for making parametric symbols. similar to Archicads GDL objects. I copied and pasted the modified points from excel directly into the ppm editor . saved it and then ran it.
The thing I like about PPM is , is the fact that the scripting language is very simple and well documented - in comparison to the SDK,
here is a link to the help file

https://turbocaddoc.atlassian.net/wiki/spaces/TG/pages/176982592/Parametric+Part+Script+Editing

Also Jeff-- and others-- we (nikki and I) advise not even wasting your time trying to use Insert/Parametric_Part.  That's a whole different tool/feature than using (and inserting via) the Parametric Parts Script Editor, and is very bug-gy.
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)