C         SUBROUTINE TO DRAW STRUCTURE
          SUBROUTINE DRAWIT(DIST,NEW,MODULE,IFUNC)
          COMMON/PAINT/I2STRT,I2END,PICT(4,100)
          COMMON/POINTS/LNS(2,15),PTS(6,100)
          COMMON/BULK/I3STRT,I3END,OBJ(6,100)
          COMMON/OIL/IVECT(300)
          COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
          COMMON/EYCEP/EYE(3),CEN(3),UP(3)
          COMMON/LINKIT/ISTRT,LINKS(6,15)
          MODL=MODULE
          IF(NEW.EQ.2)GO TO 3
          IF(NEW.EQ.1)GO TO 1
3         MOD=MODULE
9         CALL CRT(3,MOD)
          CALL NEXT(MOD,MODULE)
          IF(MOD.EQ.MODULE)GO TO 4
          GO TO 9
4         IF(NEW.NE.2)GO TO 2
1         CALL ROTER
2         I2STRT=LNS(1,MODL)
          I2END=LNS(2,MODL)
          I3STRT=I2STRT
          I3END=I2END
          CALL MAPPER(DIST)
          CALL VECTOR(1,PICT,I2STRT,I2END,IVECT,1,LAST,6,0,-1)
          CALL CRT(IFUNC,MODL,IVECT,1,LAST)
          CALL NEXT(MODL,MODULE)
          IF(MODL.EQ.MODULE)GO TO 5
          GO TO 2
5         NEW=0
          RETURN
          END
