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

Shift Weight (update)


Shifting the Origin

When you need to relocate the origin of the coordinate system, the worst part of the task might be shifting a complex weight distribution. Part Maker makes it easy to shift the origin of the geometry using the SHIFT command, but there may remain a monster multi-line WEIGHT command for light ship distribution that has to be dealt with.

The following macro demonstrates how this can be done painlessly.

 MACRO SHIFTADD
  i:=i+1
  ADD ({i}) s /ACCESS
  IF "{s}"="" THEN EXIT
  ADD "{s}", *, *+%1 /NOWARN
  EXIT SHIFTADD %1
 /
 variable (str) s
 variable i=0
 .SHIFTADD 50

Note that this depends on ADD (1) accessing light ship as defined by the WEIGHT command.

Any other commands that reference the longitudinal axis of the coordinate system must be edited independently (GROUND, PULL, THRUST, REF, CRTPT, LWL, LBP).

What follows is an example.

The status before the origin shift:





After the geometry has been shifted, the weight curve is still in the old location:


After running the macro (once!) the weight curve it looks like this:


And the Status matches except the Longitudinal numbers are all shifted by 50 meters.




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