$TYPECHECK ON
DECLARE SUB dfBegin ()
DECLARE SUB dfCircle (Lay AS STRING ,EC AS STRING,xX AS DOUBLE,xY AS DOUBLE,xZ AS DOUBLE,xRadius AS DOUBLE)
DECLARE SUB dfLine (Lay AS STRING ,Lty AS STRING,EC AS STRING, xX1 AS DOUBLE, xY1 AS DOUBLE, xZ1 AS DOUBLE, xX2 AS DOUBLE, xY2 AS DOUBLE, xZ2 AS DOUBLE, xH AS DOUBLE)
DECLARE SUB dfBeginPline (Lay AS STRING,EC AS STRING)
DECLARE SUB dfPlVertex (Lay AS STRING,EC AS STRING,X AS DOUBLE,Y AS DOUBLE,Z AS DOUBLE)
DECLARE SUB dfEndPline (Lay AS STRING,EC AS STRING)
DECLARE SUB dfEnd ()
DECLARE SUB dfText (FileNum AS INTEGER,Lay AS STRING, EC AS STRING,X AS DOUBLE,Y AS DOUBLE, Z AS DOUBLE,TextDXF AS STRING,HeightTxt AS DOUBLE,Factor AS DOUBLE,Angle AS DOUBLE,Alignh AS DOUBLE,Alignv AS DOUBLE,StyleTxt AS STRING)
DECLARE SUB dfpoint (FileNum AS INTEGER, Lay AS STRING, EColor AS STRING, X AS DOUBLE,Y AS DOUBLE, Z AS DOUBLE)
DIM DXFOUT AS QFILESTREAM
DIM DXFNAME AS STRING
DIM layer AS STRING
DIM EColor AS STRING
DIM LType AS STRING
DIM TEXTDXF AS STRING
DEFDBL x0,y0,z0,x1,x2,y1,y2,z1,z2,h,Radius,x,y,z
DEFDBL HeightTxt,Factor,Angle,Alignh,Alignv
DEFSTR StyleTXT
DIM FileNum AS INTEGER
SUB dfBegin()
DXFOUT.WriteLine ( " 0")
DXFOUT.WriteLine ( "SECTION")
DXFOUT.WriteLine ( " 2")
DXFOUT.WriteLine ( "HEADER")
DXFOUT.WriteLine ( " 999")
DXFOUT.WriteLine ( "http://www.ualg.pt/est/adec/dxfortran/")
DXFOUT.WriteLine ( " 0")
DXFOUT.WriteLine ( "ENDSEC")
DXFOUT.WriteLine ( " 0")
DXFOUT.WriteLine ( "SECTION")
DXFOUT.WriteLine ( " 2")
DXFOUT.WriteLine ( "ENTITIES")
END SUB
SUB dfEnd()
DXFOUT.WriteLine ( " 0")
DXFOUT.WriteLine ("ENDSEC")
DXFOUT.WriteLine (" 0")
DXFOUT.WriteLine ("EOF")
dxfout.CLOSE
END SUB
SUB dfCircle (Layer AS STRING ,EColor AS STRING,X AS DOUBLE,Y AS DOUBLE,Z AS DOUBLE,Radius AS DOUBLE)
DXFOUT.WriteLine ( " 0" )
DXFOUT.WriteLine ( "CIRCLE")
DXFOUT.WriteLine ( " 8")
DXFOUT.WriteLine (Layer)
IF UCASE$(EColor)="BYLAYER" THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (EColor)
END IF
DXFOUT.WriteLine (" 10")
DXFOUT.WriteLine (STR$(X))
DXFOUT.WriteLine (" 20")
DXFOUT.WriteLine (STR$(Y))
DXFOUT.WriteLine (" 30")
DXFOUT.WriteLine (STR$(Z))
DXFOUT.WriteLine (" 40" )
DXFOUT.WriteLine (STR$(Radius))
END SUB
SUB dfLine (Layer AS STRING,Ltype AS STRING,EColor AS STRING, X1 AS DOUBLE, Y1 AS DOUBLE, Z1 AS DOUBLE, X2 AS DOUBLE, Y2 AS DOUBLE, Z2 AS DOUBLE, H AS DOUBLE)
DXFOUT.WriteLine ( " 0")
DXFOUT.WriteLine ( "LINE")
DXFOUT.WriteLine ( " 8")
DXFOUT.WriteLine (Layer)
DXFOUT.WriteLine ( " 6")
DXFOUT.WriteLine (Ltype)
IF (UCASE$(EColor)="BYLAYER") THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (EColor)
END IF
DXFOUT.WriteLine ( " 39")
DXFOUT.WriteLine (STR$(H))
DXFOUT.WriteLine (" 10")
DXFOUT.WriteLine (STR$( X1))
DXFOUT.WriteLine (" 20")
DXFOUT.WriteLine (STR$( Y1))
DXFOUT.WriteLine (" 30")
DXFOUT.WriteLine (STR$( Z1))
DXFOUT.WriteLine (" 11")
DXFOUT.WriteLine (STR$( X2))
DXFOUT.WriteLine (" 21")
DXFOUT.WriteLine (STR$( Y2))
DXFOUT.WriteLine (" 31")
DXFOUT.WriteLine (STR$( Z2))
END SUB
SUB dfBeginPline (Layer AS STRING,EColor AS STRING)
DXFOUT.WriteLine (" 0")
DXFOUT.WriteLine ("POLYLINE")
DXFOUT.WriteLine (" 8")
DXFOUT.WriteLine (Layer)
IF (UCASE$(EColOr)="BYLAYER") THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (EColor)
END IF
DXFOUT.WriteLine ( " 66")
DXFOUT.WriteLine ( " 1")
DXFOUT.WriteLine ( " 0")
END SUB
SUB dfEndPline (Layer AS STRING, EColOr AS STRING)
DXFOUT.WriteLine ("SEQEND")
DXFOUT.WriteLine (" 8")
DXFOUT.WriteLine (Layer)
IF (UCASE$(EColor)="BYLAYER") THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (EColor)
END IF
END SUB
SUB dfPlVertex (Layer AS STRING,ECoLOr AS STRING,X AS DOUBLE,Y AS DOUBLE,Z AS DOUBLE)
DXFOUT.WriteLine ("VERTEX")
DXFOUT.WriteLine (" 8")
DXFOUT.WriteLine (Layer)
IF (UCASE$(EColOr)="BYLAYER") THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (EColor)
END IF
DXFOUT.WriteLine (" 10")
DXFOUT.WriteLine (STR$(X))
DXFOUT.WriteLine (" 20")
DXFOUT.WriteLine (STR$(Y))
DXFOUT.WriteLine (" 30")
DXFOUT.WriteLine (STR$(Z))
DXFOUT.WriteLine (" 0")
END SUB
SUB dfText (FileNum,Layer, EntColr,X,Y, Z,Text,Height,Factor,Angle,Alignh,Alignv,Style)
DXFOUT.WriteLine (" 0")
DXFOUT.WriteLine ("TEXT")
DXFOUT.WriteLine (" 8")
DXFOUT.WriteLine (RTRIM$(Layer))
IF (EColor="BYLAYER") THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine ( RTRIM$(EColor))
END IF
DXFOUT.WriteLine (" 10")
DXFOUT.WriteLine (STR$(x))
DXFOUT.WriteLine (" 20")
DXFOUT.WriteLine (STR$(y))
DXFOUT.WriteLine (" 30")
DXFOUT.WriteLine (STR$(z))
DXFOUT.WriteLine (" 40")
DXFOUT.WriteLine (STR$(HeightTxt))
DXFOUT.WriteLine ( " 41")
DXFOUT.WriteLine (STR$(Factor))
DXFOUT.WriteLine (" 1")
DXFOUT.WriteLine ( textDXF)
DXFOUT.WriteLine ( " 50")
DXFOUT.WriteLine ( STR$(Angle))
DXFOUT.WriteLine ( " 7")
DXFOUT.WriteLine ( RTRIM$(styleTxt))
DXFOUT.WriteLine ( " 72")
DXFOUT.WriteLine (STR$(alignh))
DXFOUT.WriteLine ( " 11")
DXFOUT.WriteLine (STR$( X))
DXFOUT.WriteLine (" 21")
DXFOUT.WriteLine ( STR$(Y))
DXFOUT.WriteLine (" 73")
DXFOUT.WriteLine (STR$( alignv))
END SUB
SUB dfpoint (FileNum, Layer, EColor, X,Y, Z)
DXFOUT.WriteLine (" 0")
DXFOUT.WriteLine ("POINT")
DXFOUT.WriteLine (" 8")
DXFOUT.WriteLine (RTRIM$(Layer))
IF (UCASE$(EColor)="BYLAYER" ) THEN
ELSE
DXFOUT.WriteLine (" 62")
DXFOUT.WriteLine (RTRIM$(EColor))
END IF
DXFOUT.WriteLine (" 10")
DXFOUT.WriteLine (STR$(X))
DXFOUT.WriteLine (" 20")
DXFOUT.WriteLine (STR$(Y))
DXFOUT.WriteLine (" 30")
DXFOUT.WriteLine (STR$(Z))
END SUB
|
|