|
|
General HydroStatics
Ship Stability Software |
|
Command of the Week
(New or interesting aspects of GHS that you may not know about) |
|
GF VARIABLES (review)
|
|
The Part Maker documentation mentions that variables are "placed in the Geometry File header ... so when read by GHS the variables will be stored in the GF module."
In other words, when Part Maker writes a Geometry File, it includes variable names and their values in the file. Thereafter, whenever that Geometry File is read by the GHS main program, those variables show up in the GF module. What is the GF module? In GHS terminology, modules are named regions in which variables and macros may be placed and thereafter accessed by including the module name as a prefix. When the READ command in the main program finds variables in the Geometry File, it places those variable names and their values in a module it names GF. How are variables created in Part Maker? When your ENTER PM command occurs in a Run File, GHS scans ahead and preprocesses commands being passed to PM, substituting variable names with their values. Therefore GHS variables are not treated as variables by PM, and they are not included in the Geometry File. Part Maker has its own syntax for creating variables. Here is an example using PMX: |
ENTER PMX READ ASHIP.GF real MidBodyLen:=100 real HoldLen:=MidBodyLen/2 real x1f:=20 CREATE AHOLD1X.C ENDS x1f, x1f+HoldLen FIT HULL / WRITE ASHIP2.GF QUIT PM |
Back in the main program environment, the variables defined in the PMX
environment and stored in the Geometry File can be accessed.
For example,
variable HoldLen={GF.HoldLen}
(Since the purpose of this is to communicate from Part Maker to the main program,
the Geometry File does not normally bring them back into Part Maker.)
|
|
Questions, comments, or requests?
Contact Creative Systems, Inc. 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 Click here for an index to this and previous COWs |