
! script name: macros.d/duck
! EXAMPLE: macro to construct duck shape using type numbers

!A
!A NAME:
!A
!A 	Duck
!A
!A DESCRIPTION:
!A
!A 	This script is a macro which automatically
!A 	creates the duck shape using type numbers.
!A

stat=ChangeLabelStr("ScriptNameStatus","Function: duck ")

DEG
DeActivateUndo
Units= CurrentUnits
Conv=1

IF Units= WsMetric THEN Conv= 25.4

Xr=-1.5*Conv
Yr=0
X=0
Y=0
R1=0
R2=.75*Conv
First=Type3(3,Xr,Yr,X,Y,R1,R2)
Xr=X
Yr=Y
R1=R2

Last=FindLastType
X=Xr+3.5*Conv
Y=Yr
R2=-5*Conv
R3=-.4*Conv
Tp=Type4(4,Last,X,Y,0,R2,R3)
Xr=X
Yr=Y
R1=R3
Stat=JoinTypes(Last,Tp)

X=Xr-1.5*Conv
Y=Yr+4*Conv
R2=2*Conv
R3=-.5*Conv
Last=FindLastType
Tp=Type4(4,Last,X,Y,0,R2,R3)
Xr=X
Yr=Y
R1=R3
Stat=JoinTypes(Last,Tp)

X=Xr-1.5*Conv
Y=Yr+3*Conv
R2=-.6*Conv
Last=FindLastType
Tp=Type3(3,Last,X,Y,0,R2)
Xr=X
Yr=Y
R1=R2
Stat=JoinTypes(Last,Tp)

X=Xr-3*Conv
Y=Yr-7*Conv
R2=-7*Conv
R3=-.5*Conv
Last=FindLastType
Tp=Type4(4,Last,X,Y,0,R2,R3)
Xr=X
Yr=Y
R1=R3
Stat=JoinTypes(Last,Tp)

X=-1.5*Conv
Y=0
R2=0
Last=FindLastType
Tp=Type3(3,Last,First,0,25)
Xr=X
Yr=Y
R1=R2
Stat=JoinTypes(Last,Tp)
Stat=CloseType(Tp)
Duck=TypesContour(Tp,1)

 LOAD "typecontrol"

END
