Welcome, Guest. Please login or register.
Did you miss your activation email?
September 06, 2010, 03:16:20 AM
Home Help Search Login Register
News: All posts discussing pricing or where to buy TurboCAD will be deleted.

+  TurboCAD Forums
|-+  SDK Corner
| |-+  Contributions
| | |-+  VBScript to dump vertex coordinates
« previous next »
Pages: [1] Print
Author Topic: VBScript to dump vertex coordinates  (Read 2385 times)
kchapman
Administrator
Full Member
*****
Posts: 154


« on: May 29, 2009, 03: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).


* vertices.zip (1.59 KB - downloaded 146 times.)
Logged
Michael Geraghty
Full Member
***
Posts: 197


« Reply #1 on: June 02, 2009, 08:15:21 AM »

Tried this VBScript Kevan, and it worked without any problem.
Logged
Marek
Newbie
*
Posts: 3


« Reply #2 on: October 21, 2009, 05:13:40 AM »

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
kchapman
Administrator
Full Member
*****
Posts: 154


« Reply #3 on: October 21, 2009, 08:38:50 AM »

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
kchapman
Administrator
Full Member
*****
Posts: 154


« Reply #4 on: February 17, 2010, 03:45:32 PM »

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.

* vertices_MR.zip (1.32 KB - downloaded 78 times.)
Logged
Marek
Newbie
*
Posts: 3


« Reply #5 on: April 01, 2010, 10:13:12 AM »

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.

* Vertices_export.zip (8.27 KB - downloaded 39 times.)
* Vertices_import.zip (10.37 KB - downloaded 37 times.)
* Import_points.zip (10.39 KB - downloaded 32 times.)
* Rys1.2CDverts.txt (1.68 KB - downloaded 34 times.)
Logged
Andre Arpin
Newbie
*
Posts: 21


« Reply #6 on: April 16, 2010, 08:43:42 AM »

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
Marek
Newbie
*
Posts: 3


« Reply #7 on: July 26, 2010, 02:03:12 AM »

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.


* Snap1.jpg (22.03 KB, 772x584 - viewed 28 times.)

* Snap2.jpg (41 KB, 758x584 - viewed 25 times.)
* plAC.zip (10.45 KB - downloaded 14 times.)
* Import_points2.zip (10.48 KB - downloaded 13 times.)
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!