      SUBROUTINE TRNS(V,T)
      DIMENSION T(3)
      KK=LENSTR(T,V)
      RETURN
      END
      SUBROUTINE ANSTRY(NCHAR,XNADE)
      DIMENSION XNADE(1)
      CALL ANMODE
      IX=NCHAR/4
      IF(IX.LT.1)GO TO 10
      IF(IX*4.EQ.NCHAR)GO TO 30
      IX=IX+1
      GO TO 30
10    IX=1
30    IXB=IX*4
      CALL ANSTR3(NCHAR,XNADE,IX,IXB)
      RETURN
      END
      SUBROUTINE ANSTR3(NCHAR,XNADE,IX,IXB)
      COMMON/IGL100/IGLKEY,IBAUD,IDEV,IOPT,PXSIZE,PYSIZE
      DIMENSION XNADE(IX)
      IHOR=PXSIZE
      IVER=PYSIZE
      CALL CSIZE(IHOR,IVER)
      DO 33 I=1,IX
      CALL ANSTR(1,XNADE(I))
      CALL LINREL(0,-IVER,0)
      CALL LINREL(-IHOR,-IVER,0)
      CALL ANMODE
33    CONTINUE
      RETURN
      END
      SUBROUTINE PLINE1(IX,IY,IPEN,LINTYP)
      COMMON/BEAPOS/IX1,IY1
      IF(IPEN.EQ.1)GO TO 10
      X=FLOAT(IX)*1.4
      IX1=IFIX(X)
      IY1=IY
      RETURN
10    X=FLOAT(IX)*1.4
      IIX=IFIX(X)
      WRITE(23,11)IX1,IY1,LINTYP,IIX,IY
11    FORMAT(1X,8H`PLINE (,I4,1H,,I4,1H),I2,1H,,I4,1H,,I4,1H!)
      IX1=IIX
      IY1=IY
      RETURN
      END
      SUBROUTINE LINE2(X,Y,IPEN)
      COMMON/HP21/IHP,PAT,HI21,X21,Y21
      COMMON/CALCOM/ICAL
      COMMON/IGL100/IGLKEY
      IF(ICAL.EQ.1)GO TO 2
      IIX=X
      IIY=Y
      IF(IPEN.EQ.1)CALL MOVEA(X,Y)
      IF(IPEN.EQ.4)CALL DRWREL(IIX,IIY)
      IF(IPEN.EQ.3)CALL MOVREL(IIX,IIY)
      GO TO 10
2     WRITE(10,21)IPEN,X,Y
21    FORMAT(I10,2F10.3)
10    RETURN
      END
      SUBROUTINE PLOTDT(ITYP,IX,IA,NCP)
      COMMON/UNIT/II11,II22
      DIMENSION IIX(60),IX(8),KOD(20),IA(20),KEX(80)
      IF(ITYP.EQ.0)WRITE(19)ITYP
      IF(ITYP.EQ.0)RETURN
      IX1=-IX(1)
      GO TO (10,20,30,50,60,80,90,100,110,120,400,400,400,90,400,400
     1,90,600),ITYP
      GO TO 500
10    NCP=2
      WRITE(19)NCP
      WRITE(19)IX1,IX(2)
      GO TO 520
20    GO TO 10
30    NCP=5
      IF(IX(4).EQ.0)GO TO 40
      WRITE(19)NCP
      WRITE(19)IX1,IX(2),IX(3),IX(4),IX(1)
      GO TO 520
40    NCP=4
      WRITE(19)NCP
      WRITE(19)IX1,IX(2),IX(3),IX(1)
      GO TO 520
50    GO TO 30
60    IF(IX(7).EQ.0) GO TO 70
      NCP=16
      WRITE(19)NCP
      IX2=-IX(2)
      IX3=-IX(3)
      IX4=-IX(4)
      WRITE(19)IX1,IX(2),IX(3),IX(4),IX(1),IX(5),IX(6),IX(7),
     1IX(8),IX(5),IX4,IX(8),IX3,IX(7),IX2,IX(6)
      GO TO 520
70    NCP=12
      WRITE(19)NCP
      IX2=-IX(2)
      IX3=-IX(3)
      IX4=-IX(4)
      WRITE(19)IX1,IX(2),IX(3),IX(1),IX(4),IX(5),IX(6),IX(4),
     1IX2,IX(5),IX3,IX(6)
      GO TO 520
80    GO TO 30
90    MHIM=0
      WRITE(19)MHIM
      GO TO 520
100   GO TO 30
110   NCP=3
      WRITE(19)NCP
      WRITE(19)IX1,IX(2),IX(3)
      GO TO 520
120   DO 130 I=1,8
130   KOD(I)=IX(I)
      DO 140 I=9,20
140   KOD(I)=IA(I)
      KOD1=-KOD(1)
      KOD2=-KOD(2)
      KOD3=-KOD(3)
      KOD4=-KOD(4)
      KOD5=-KOD(5)
      JF=1
150   IF (KOD(9) .EQ. 0) GO TO 160
      KEX(JF)=KOD1
      JF=JF+1
      KEX(JF)=KOD(9)
      JF=JF+1
      KEX(JF)=KOD(2)
      JF=JF+1
      GO TO 170
160   KEX(JF)=KOD1
      JF=JF+1
      KEX(JF)=KOD(2)
      JF=JF+1
170   IF (KOD(10) .EQ. 0) GO TO 180
      KEX(JF)=KOD(10)
      JF=JF+1
      KEX(JF)=KOD(3)
      JF=JF+1
      GO TO 190
180   KEX(JF)=KOD(3)
      JF=JF+1
190   IF (KOD(11) .EQ. 0) GO TO 200
      KEX(JF)=KOD(11)
      JF=JF+1
      KEX(JF)=KOD(4)
      JF=JF+1
      GO TO 210
200   KEX(JF)=KOD(4)
      JF=JF+1
210   IF (KOD(12) .EQ. 0) GO TO 220
      KEX(JF)=KOD(12)
      JF=JF+1
      KEX(JF)=KOD(1)
      JF=JF+1
      GO TO 230
220   KEX(JF)=KOD(1)
      JF=JF+1
230   IF (KOD(13) .EQ. 0) GO TO 240
      KEX(JF)=KOD5
      JF=JF+1
      KEX(JF)=KOD(13)
      JF=JF+1
      KEX(JF)=KOD(6)
      JF=JF+1
      GO TO 250
240   KEX(JF)=KOD5
      JF=JF+1
      KEX(JF)=KOD(6)
      JF=JF+1
250   IF (KOD(14) .EQ. 0) GO TO 260
      KEX(JF)=KOD(14)
      JF=JF+1
      KEX(JF)=KOD(7)
      JF=JF+1
      GO TO 270
260   KEX(JF)=KOD(7)
      JF=JF+1
270   IF (KOD(15) .EQ. 0) GO TO 280
      KEX(JF)=KOD(15)
      JF=JF+1
      KEX(JF)=KOD(8)
      JF=JF+1
      GO TO 290
280   KEX(JF)=KOD(8)
      JF=JF+1
290   IF (KOD(16) .EQ. 0) GO TO 300
      KEX(JF)=KOD(16)
      JF=JF+1
      KEX(JF)=KOD(5)
      JF=JF+1
      GO TO 310
300   KEX(JF)=KOD(5)
      JF=JF+1
310   IF (KOD(17) .EQ. 0) GO TO 320
      KEX(JF)=KOD(17)
      JF=JF+1
      KEX(JF)=KOD(1)
      JF=JF+1
      GO TO 330
320   KEX(JF)=KOD(1)
      JF=JF+1
330   IF (KOD(18) .EQ. 0) GO TO 340
      KEX(JF)=KOD2
      JF=JF+1
      KEX(JF)=KOD(18)
      JF=JF+1
      KEX(JF)=KOD(6)
      JF=JF+1
      GO TO 350
340   KEX(JF)=KOD2
      JF=JF+1
      KEX(JF)=KOD(6)
      JF=JF+1
350   IF (KOD(19) .EQ. 0) GO TO 360
      KEX(JF)=KOD3
      JF=JF+1
      KEX(JF)=KOD(19)
      JF=JF+1
      KEX(JF)=KOD(7)
      JF=JF+1
      GO TO 370
360   KEX(JF)=KOD3
      JF=JF+1
      KEX(JF)=KOD(7)
      JF=JF+1
370   IF (KOD(20) .EQ. 0) GO TO 380
      KEX(JF)=KOD4
      JF=JF+1
      KEX(JF)=KOD(20)
      JF=JF+1
      KEX(JF)=KOD(8)
      JF=JF+1
      GO TO 390
380   KEX(JF)=KOD4
      JF=JF+1
      KEX(JF)=KOD(8)
      JF=JF+1
390   CONTINUE
      NCP=JF-1
      WRITE(19)NCP
      WRITE(19)(KEX(JJJ),JJJ=1,NCP)
      GO TO 520
400   NCP=0
      IF(IX(5).EQ.0) GO TO 410
      IIX(1)=IX1
      IIX(2)=IX(5)
      IIX(3)=IX(2)
      NCP=NCP+3
      GO TO 420
410   IIX(1)=IX1
      IIX(2)=IX(2)
      NCP=NCP+2
420   IF (IX(6).EQ.0) GO TO 430
      IIX(NCP+1)=IX(6)
      IIX(NCP+2)=IX(3)
      NCP=NCP+2
      GO TO 440
430   IIX(NCP+1)=IX(3)
      NCP=NCP+1
440   IF (IX(7).EQ.0) GO TO 450
      IIX(NCP+1)=IX(7)
      IF(IX(4).EQ.0)GO TO 465
      IIX(NCP+2)=IX(4)
      NCP=NCP+2
      GO TO 460
450   IF(IX(4).EQ.0)GO TO 460
      NCP=NCP+1
      IIX(NCP)=IX(4)
460   IF (IX(8).EQ.0) GO TO 470
461   IIX(NCP+1)=IX(8)
      IIX(NCP+2)=IX(1)
      NCP=NCP+2
      GO TO 480
465   IIX(NCP+2)=IX(1)
      NCP=NCP+2
      GO TO 480
470   NCP=NCP+1
      IIX(NCP)=IX(1)
480   IF(ITYP.NE.16)GO TO 481
      IF(IA(9).EQ.0)GO TO 481
      IIX(NCP+1)=-IA(9)
      NCP=NCP+1
481   WRITE(19) NCP
      WRITE(19) (IIX(I),I=1,NCP)
      GO TO 520
500   WRITE(*,510)ITYP
510   FORMAT(' ***** PLOTTER FOR ELEMENT TYPE ',I3,'NOT AVAILABLE')
520   RETURN
600   DO 601 I=1,8
601   KOD(I)=IX(I)
      DO 602 I=9,20
602   KOD(I)=IA(I)
      NCP=1
      K1K=0
      IIX(1)=IX1
      NCP=NCP+1
      IF(KOD(5).EQ.0)GO TO 610
      IIX(NCP)=KOD(5)
      NCP=NCP+1
610   IF(KOD(9).EQ.0)GO TO 620
      K1K=0
      DO 621 I=10,16
      IF(KOD(I).NE.0)K1K=1
621   CONTINUE
      IF(K1K.EQ.1)GO TO 622
      GO TO 620
622   IIX(NCP)=KOD(9)
      NCP=NCP+1
620   IIX(NCP)=KOD(2)
      NCP=NCP+1
      IF(KOD(6).EQ.0)GO TO 630
      IIX(NCP)=KOD(6)
      NCP=NCP+1
630   IF(KOD(10).EQ.0)GO TO 640
      IIX(NCP)=KOD(10)
      NCP=NCP+1
640   IIX(NCP)=KOD(3)
      NCP=NCP+1
      IF(KOD(7).EQ.0)GO TO 650
      IIX(NCP)=KOD(7)
      NCP=NCP+1
650   IF(KOD(11).EQ.0)GO TO 660
      IIX(NCP)=KOD(11)
      NCP=NCP+1
660   IIX(NCP)=KOD(4)
      NCP=NCP+1
      IF(KOD(8).EQ.0)GO TO 670
      IIX(NCP)=KOD(8)
      NCP=NCP+1
670   IF(KOD(12).EQ.0)GO TO 680
      IIX(NCP)=KOD(12)
      NCP=NCP+1
680   IIX(NCP)=KOD(1)
      IF(KOD(13).EQ.0)GO TO 690
      NCP=NCP+1
      IIX(NCP)=-KOD(13)
690   IF(KOD(14).EQ.0)GO TO 691
      NCP=NCP+1
      IIX(NCP)=-KOD(14)
691   IF(KOD(15).EQ.0)GO TO 692
      NCP=NCP+1
      IIX(NCP)=-KOD(15)
692   IF(KOD(16).EQ.0)GO TO 693
      NCP=NCP+1
      IIX(NCP)=-KOD(16)
693   CONTINUE
      IF(K1K.EQ.0)NCP=NCP+1
      IF(K1K.EQ.0)IIX(NCP)=-KOD(9)
      WRITE(19)NCP
      WRITE(19)(IIX(JJJ),JJJ=1,NCP)
      RETURN
      END
