General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)

READ (DATA)


When your only tools are CTRL-C and CTRL-V, you're effectively operating with the data parsing equivalent of stone tools. Yes, you can chop down that tree with a stone axe, and sure, it won't take you much to get started, but what if it is a really big tree? Data is ubiquitous in engineering work, and the parsing and subsequent manipulation is, for-better-or-worse, a common occurrence in the modern workflow. It doesn't take a very big dataset before you start to feel a bit sheepish standing there with your stone axe. Save yourself the agony, and the blisters, and take a moment to explore the utility that READ (DATA) offers savvy GHS users.

READ (DATA) does exactly what the name implies: it reads data. But the power of this command cannot be overstated. To illustrate this fact, we've created a run file that uses READ (DATA) to convert any shape record from a geometry file into LOCUS commands, which are then put in a separate file. All you need to do is specify the name of the shape you want to convert, and READ (DATA) will speedily parse the geometry file and convert the shape record into easily editable LOCUS commands, one for each station. Try that with copy-and-paste.

read (data) "FV.GF" /delim:","
.convert_shape "HULL"
.convert_shape "FOCSLE"
.convert_shape "SKEG"
read (data) off

With a LOCUS version of your shape, you can now bring these commands into a Part Maker run file and edit the offsets, or convert entire geometry files with multiple convert_shape macro calls.

The result is obviously quite useful, but how did we do it? We will leave the details of the convert_shape macro to the run file, but it is based entirely around READ (and a few WRITE) commands and is really quite simple. Before reviewing the run file, you may wish to read HELP GF for a useful description of the GF file format.

For a detailed how-to discussion on READ (DATA), see this new bulletin. We've also created another data parsing example that uses many of the techniques discussed in the bulletin and includes step-by-step commentary. Find it at the bottom of the page.

Questions, comments, or requests?
Contact Creative Systems, Inc.

support@ghsport.com

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

www.ghsport.com

Click here for an index to this and previous COWs