TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
When replying to a specific statement be sure to quote the previous post.

VBScript to dump vertex coordinates
Read 8813 times
* May 29, 2009, 04:12:22 PM
The attached vbscript will dump the vertices of all selected top-level graphics into a text file. Vertices for each object are separated by a blank line.

Usage:
Unzip the vbs file into a folder of your choice.
Open TurboCAD, open a drawing, and select one or more objects.
Right-click on the vbs file and choose Open. (If Windows asks what program to open the file with, browse to c:\Windows\System32\wscript.exe.)
The script will tell you where to find the output file when it is done.

Limitations:
The script currently has almost no error-handling.
It only handles top-level graphics.
There is no annotation indicating what sort of graphics are being processed.
The script does not work from within TurboCAD's Macro Recorder Palette. I may attempt a Macro Recorder-compatible version at a later date.

Comments and suggestions for improvements are welcome (as are contributions of improved versions).



[attachment deleted by admin]

Logged


* June 02, 2009, 09:15:21 AM
#1
Tried this VBScript Kevan, and it worked without any problem.

Logged


* October 21, 2009, 06:13:40 AM
#2
Hi. I do not visited the forum Tcad long time. And as we can see worth. I started using DCAD. There was no such thing since we can't use in Tcad *. tcm files. Very cool script. Also works for DCAD. I tried to export the polygon, terrain and the same points. I changed only as a separator between X, Y, Z "," to " " , and removed for export points "blank line".Such txt file we can import to other cad programs.  Be useful to have something to import x, y, z data.

Logged
Marek

TurboCAD Pro 2016, TurboCAD Pro 2017
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit


* October 21, 2009, 09:38:50 AM
#3
Be useful to have something to import x, y, z data.

An excellent suggestion! I'll try to come up with something as soon as I can get to it.

Logged


* February 17, 2010, 03:45:32 PM
#4
Macro Recorder Palette compatible version of xyz exporter.

Unzip the attached Vertices_MR.zip to your default folder for recorded macros.
Open the Macro Recorder palette, and click on the "Open" icon.
Change the filetype to vbs, and load vertices_MR.vbs.
Select the objects whose vertices you want to dump.
Play the script.
The script will prompt you with the name and location of the text file it creates.
For now it always creates a "verts.txt" file, either in the same folder as the drawing itself, or in the Program folder if the drawing hasn't been saved yet.

[attachment deleted by admin]

Logged


* April 01, 2010, 11:13:12 AM
#5
Hi. I tried to do something in VB 2008. I attached results. This scripts work for Dcad and Tcad. First was wrote by Kevin Chapman for dump vertex coordinates (x,y,z) .I modified  it for my needs  (1.from VBS to VB 2008, 2. only data without any descriptions in exporting txt file 3.rounding precision to 3 decimal places). Second is for import vertices and third for import points ( I use then architecture tool - terrain from points). These scripts were not tested   on a lot of errors, but may be usefull for somebody. I attached exemplary txt file.

Logged
Marek

TurboCAD Pro 2016, TurboCAD Pro 2017
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit


* April 16, 2010, 09:43:42 AM
#6
This is a great script thank you

Added
        WriteBlocks(TCDraw.Blocks)
just before the MsgBox  ... save the file

and the following subroutine
    Private Sub WriteBlocks(ByVal TCBlocks As IMSIGX.Blocks)
        For Each TCBlock As IMSIGX.Block In TCBlocks
            OutFile.WriteLine("Block:" & TCBlock.Name)
        Next
    End Sub

This give you a  list of all the blocks.

Then I wrote a simple script which give me a part list given that each part is a block.
There is probably a much better way to get a part list, but I could not find it.

Andre

Logged


* July 26, 2010, 03:03:12 AM
#7
In Acad I can insert points manually - I point out place on drawing ( in this moment I have X,Y coordinates) and then I determine description of point and Z coordinate. In Tcad I devised for myself such way : 1. I have to create block from point ( for example cross) and two attributes ( first N-number of point and second Z coordinate in such a specific sequence and reference point exactly in my point). 2. Now I can put these blocks in any place and describe N and Z. After it I select this blocks ( for example by Query and block's name) and run script plAC.exe. I have now txt file  with N X Y Z data or X Y Z data, which can be imported to others programmes. If I want to get really 3D points in Tcad I have run second script Import_points2.exe and then I get X Y Z data in Tcad drawing on layer "plAC". Now  I can select points by layer and run architecture tool "terrain from points".I attached  those scripts - may be useful for someone. Attention - Scripts have not been tested on a lot of errors. I tried too, in Tcad Pro v 15 in this way import point for 3D polyline and then connect this points with 3D polylline.

Logged
Marek

TurboCAD Pro 2016, TurboCAD Pro 2017
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit