GHS Port Reference Center
Information for maritime designers, engineers and builders
Maintained by Creative Systems, Inc., Creators of GHS
Click here for information about GHS and other fine marine software.
Go to Main page

Example of using macros in Part Maker to reduce repetition.
    `Example of using macros in Part Maker to reduce repetition:
    `A barge carrying 180 bottles in its hold.
    
    proj bottles
    
    enter pm
    create hull
    ends 0 100
    top 20
    bot 0
    out 17
    /
    create hold.c
    ends 25 75
    fit hull\hull.c
    /
    create bottle.c
    cyl 0 0 0  10 0 0  3
    /
    macro b
    create b%1.c
    shape bottle.c
    vector %2 %3 %4
    //
    create hold.c\b%1.c
    deduct b%1.c
    vector %2 %3 %4
    //
    /
    macro t
    .b %10%2 %3 13.5  %4
    .b %11%2 %3 10.5  %4
    .b %12%2 %3  7.5  %4
    .b %13%2 %3  4.5  %4
    .b %14%2 %3  1.5  %4
    .b %15%2 %3 -1.5  %4
    .b %16%2 %3 -4.5  %4
    .b %17%2 %3 -7.5  %4
    .b %18%2 %3 -10.5 %4
    .b %19%2 %3 -13.5 %4
    /
    macro v
    .t %1 0 %2  3
    .t %1 1 %2  6
    .t %1 2 %2  9
    .t %1 3 %2 12
    .t %1 4 %2 15
    .t %1 5 %2 18
    /
    .v 0 30
    .v 1 45
    .v 2 60
    delete bottle.c
    write
    qu pm
    di
    
    

Add a free link to your site
Copyright © , Creative Systems, Inc.