`RUN FILE BY S.DARDEL/ NDAR FEB 2015:

`TEMPLATE example: creates a simple barge and internal tanks

`from input dimensions.

 

clear

Proj DIVHULL

VARI HEND1,HEND2,HOUT,HTOP,HLL

VARI LDIV, VDIV

VARI TKOUT, TKTOP,TKLL

VARI (STR) INGF

VARI COUNT1, COUNT2

 

IF FEXIST Variable.sav THEN Run variable.sav /call

 

 

TEMPLATE TNKMKR "Barge + tank Maker" /pos:mouse /min /backcolor:7 /size:1

@"dst-logo1.jpg" /h:6

"Designed by NDAR / Design Systems & Technologies 2015" /color:9

""

""

"This run file will create a barge and create tanks of equal volumes"

BREAK LINE

"Enter a name for the geometry file you wish to create:"INGF

"(Do not include .gf* suffix)"

""

""

<BOX:"1.Hull Maker">

"Hull length:"HLL /tip:"Enter hull length here"

"Hull breadth:"HOUT /tip:"Enter moulded breadth"

"Hull height:"HTOP /tip:"Enter hull height"</BOX>

""

""

""

<BOX:"2.Tank Maker">

"Number of longitudinal divisions:"LDIV /tip:"Number of longitudinal divisions"

"Number of transversal divisions:" /R |"2","4","6" TDIV

"Tank top height:"TKTOP</BOX>

/

 

.TNKMKR

 

write (variables) variable.sav

 

v HALFDIV

set HALFDIV = {TDIV} div 2

set TKOUT = {HOUT} div {HALFDIV}

set HEND1 = 0

set HEND2 = {HLL}

set TKLL = {HLL} div {LDIV}

 

v OUT2

SET OUT2 = {TKOUT} times 2

 

macro t

 create t%1%2.s

  shape t.s

  vector %1,%3,0 

 //

 create t%1%2.p

  shape t.s

  vector %1,-%3,0 

 //

/

 

enter pm

create hull

ENDS {HEND1},{HEND2}

OUTBOARD {HOUT}

TOP {HTOP}

BOTTOM 0

/

 

create t.s

 ends 0 {TKLL}

 out {TKOUT}

 top {TKTOP}

 fit hull

/

 

.t({LDIV} {TKLL}) 0 ,1,0

IF {TDIV} >= 4 THEN .t({LDIV} {TKLL}) 0 ,2,{TKOUT}

IF {TDIV} >= 6 THEN .t({LDIV} {TKLL}) 0 ,3,{OUT2}

 

create upper.c

ENDS {HEND1},{HEND2}

bot {TKTOP}

fit hull

/

 

delete t.s

 

WRITE {INGF}1.GF

qu

 

 

v SETDRAFT

set SETDRAFT = {HTOP} div 3

draft {SETDRAFT}

vcg {SETDRAFT}

so we lcg

load (t*) 0.25

 

di (*) status /sync

lo (*) edit