📄 atlast.dxt
字号:
\
\
\ Notes, bugs and problems:
\ (C) Copyright 1998 by Autodesk, Inc.
\ 2. The anonymous blocks *MODEL_SPACE and *PAPER_SPACE in R13 are changed
\ to the named blocks $MODEL_SPACE and $PAPER_SPACE in the R12 dxf file.
\ 3. A RAY or XLINE without any entities will result in an exceedingly
\ small line due to the small drawing extents. Putting a non-infinite
\ entity in the drawing will remedy this problem.
\ 4. *STACK 10000 - This doesn't seem to work since dictionary entries
\ have already been made.
\ 5. The stack notation: ( ... n n ) , used in the defining words below,
\ assumes that the stack grows from left to right with the right most
\ term being on top.
\ 6. Make sure you have enough disk space for the output file, otherwise
\ you will get no output.
\
\ =======================================================================
\ README information April 1997:
\
\ Header variables DWGCODEPAGE, TREEDEPTH and PINSBASE
\
\ in order to comply with R12 DXF file standards as formulated in the
\ EQM (European Quality Manual) the above header variables are removed
\ for R12 DXF files. In case they are needed, this translation file can
\ be edited and the corresponding statements remove dxf:header:... can
\ get commented out.
\
\ Fonts with Full Path Names :
\
\ in accordance with the behaviour of R13 writing out R12 drawing files,
\ all *.ttf and *.pfa based text styles are set to txt. If you don't want
\ the font file path removed by dxfix, comment the statement following the
\ line 'replace all *.ttf and *.pfa text styles with txt' out.
\
\ OCTREE 6 Error:
\
\ Some DXF files, created in Release 12, or created after using
\ the DXF translator, result in this error while being read in.
\ To "repair" the DXF file so that it can be read in, change the
\ value of TREEDEPTH Group 70 to 3020. If desired, this value
\ can then be reset to 0 from inside of AutoCAD, after the
\ drawing has been read in.
\
\ =======================================================================
\
\ Rules for translating AutoCAD Release 13 DXF files to Release 12
\ Command line options: -x => Delete RAYs and XLINEs, otherwise if this
\ option is not present they will be replaced
\ by finite lines that approximate the drawing
\ extents.
\
\
\ Changes made by this program to go from R13 to R12 DXF:
\ 1. $ACADVER changed from AC1012 to AC1009
\ The following HEADER section variables were deleted:
\ 2. $CELTSCALE
\ 3. $DELOBJ
\ 4. $DISPSILH
\ 5. $DIMJUST
\ 6. $DIMSD1
\ 7. $DIMSD2
\ 8. $DIMTOLJ
\ 9. $DIMTZIN
\ 10. $DIMALTZ
\ 11. $DIMALTTZ
\ 12. $DIMFIT
\ 13. $DIMUPT
\ 14. $DIMUNIT
\ 15. $DIMDEC
\ 16. $DIMTDEC
\ 17. $DIMALTU
\ 18. $DIMALTTD
\ 19. $DIMTXSTY
\ 20. $DIMAUNIT
\ 21. $CHAMFERC
\ 22. $CHAMFERD
\ 23. $PICKSTYLE
\ 24. $CMLSTYLE
\ 25. $CMLJUST
\ 26. $CMLSCALE
\ 27. $SAVEIMAGES
\ see remarks above: $DWGCODEPAGE, $TREEDEPTH, $PINSBASE
\
\ 28. CLASSES section deleted
\ 29. OBJECTS section deleted
\ 30. Delete 300-369 groups - arbitrary strings, chunks and handles
\ 31. Delete 100 groups - AcDb... groups (eg. AcDbSymbolTable, AcDbLinetypeTableRecord, etc)
\
\ The following ENTITIES section objects were changed:
\ 32. RAY changed into a long, but finite, line.
\ 33. ELLIPSE decomposed into polyline vertex segments.
\ 34. BODY deleted.
\ 35. OLEFRAME deleted.
\ 36. 3DSOLID deleted.
\ 37. DIMENSION removed -3 group.
\ 38. INSERT removed -3 group.
\ 39. VIEWPORT removed -3 group.
\ 40. LEADER decomposed into polyline vertex segments.
\ 41. MLINE deleted.
\ 42. TOLERANCE deleted.
\ 43. REGION deleted.
\ 44. XLINE changed into a long, but finite, line.
\ 45. MTEXT changed to TEXT.
\ 46. SEQEND removed the -2 group.
\ 47. SPLINE decomposed into polyline vertex segments.
\ 48. ZOMBIE_ENTITY deleted.
\ 'bignum' used to make RAYs and XLINEs long, finite lines.
1.0E99 2constant bignum
1.0E-3 2constant bignumerror
50 constant iterator
7 constant unicount
1.0 atan 4.0 f* 2constant pi
2.7182818 2constant e
180.0 pi f/ 2constant radToDeg
pi 180.0 f/ 2constant degToRad
0 constant false
-1 constant true
241 constant tolerSymbol
\ DOS produces this one ...
248 constant degreeSymbol
\ ... and Windows produces this one.
176 constant altDegreeSymbol
123 constant leftBrace
125 constant rightBrace
92 constant backSlash
94 constant separator
47 constant forwardSlash
59 constant semicolon
37 constant percent
32 constant space
48 constant ascii0
49 constant ascii1
50 constant ascii2
51 constant ascii3
52 constant ascii4
53 constant ascii5
54 constant ascii6
55 constant ascii7
56 constant ascii8
57 constant ascii9
99 constant littleC
100 constant littleD
108 constant littleL
111 constant littleO
112 constant littleP
117 constant littleU
65 constant bigA
67 constant bigC
68 constant bigD
70 constant bigF
72 constant bigH
76 constant bigL
79 constant bigO
80 constant bigP
81 constant bigQ
83 constant bigS
84 constant bigT
85 constant bigU
87 constant bigW
-1 constant EOF
0 constant EOS
4 constant cell
: cells cell * ;
: cell+ cell + ;
2variable bignumhi
2variable bignumlo
2variable xmax
2variable ymax
2variable zmax
variable maxset
2variable xmin
2variable ymin
2variable zmin
variable minset
variable handlesOn
variable nextHandle
variable needToRewind
32 string layer
variable icount
variable jcount
variable loopCount
variable maxi
variable maxj
2variable ftmp
variable delEndBlock
\ MText variables
variable fixedMtextGroups
variable countChar
variable thisChar
variable nextChar
variable thirdChar
variable group72
2variable textHeight
2variable textRotationPrimary
2variable textRotation
variable color
variable 62group
80 string mtextStyle
variable 7group
5 string unicodeStr
5 string diameter
5 string toler
5 string degree
0.3 2constant mtextFudge
\ R12 will not accept more than 256 characters in a DXF text entity.
\ Oddly, you can 'saveasr12' in R13 with more than 256 characters in an
\ MText entity and import the drawing into R12. However, doing a DXFOUT
\ followed by DXFIN on that same drawing in R12 will result in an error.
256 constant mtextMaxLength
file mtextFileA
\ Ellipse variables
2variable ellipsea
2variable ellipseb
2variable ellipsestartangle
2variable ellipseendangle
2variable ellipseangleincr
\ Spline variables
32 constant splineConstant
variable splineIterator
2variable firstKnot
2variable knotInterval
\ Number of segments used to approximate an ellipse.
128 constant ellipseSteps
1.0E-10 2constant ellipseanglefuzz
\ Create a matrix of doubles
: matrix
create 2dup , , * 8 * allot
;
\ Stack on entering: Stack on leaving:
: element ( ... r c addr1 ) ( ... addr1+x )
dup >r ( ... r c addr1 )
@ ( ... r c columns )
rot ( ... c columns r )
* + ( ... columns*r+c )
\ Since the array consists of doubles, multiply by 8.
8 *
\ Offset from the columns and rows stored at the head of this array.
8 +
r> + ( ... addr1+x )
;
1 3 matrix extentsMinSave
1 3 matrix extentsMaxSave
1 3 matrix vector
1 3 matrix result
1 3 matrix offset
1 3 matrix extrusion
3 3 matrix rotationMatrix
\ Stack on entering: Stack on leaving:
: 3x3print ( ... addr ) ( ... )
cr ." "Row Column Value" cr
0 icount !
begin
0 jcount !
icount @ 3 <
while
begin
jcount @ 3 <
while
icount @ dup . ( ... addr icount )
jcount @ dup . ( ... addr icount jcount )
2 pick ( ... addr icount jcount addr )
element 2@ f. cr ( ... addr )
1 jcount +!
repeat
1 icount +!
repeat
drop ( ... )
;
\ Stack on entering: Stack on leaving:
: matrixprint ( ... row col addr ) ( ... )
cr ." "Row Column Value" cr
swap ( ... row addr col )
maxj ! ( ... row addr )
swap ( ... addr row )
maxi ! ( ... addr )
0 icount !
begin
0 jcount !
icount @ maxi @ <
while
begin
jcount @ maxj @ <
while
icount @ dup . ( ... addr icount )
jcount @ dup . ( ... addr icount jcount )
2 pick ( ... addr icount jcount addr )
element 2@ f. cr ( ... addr )
1 jcount +!
repeat
1 icount +!
repeat
drop ( ... )
;
\ Stack on entering: Stack on leaving:
: matrixclear ( ... row col addr ) ( ... )
swap ( ... row addr col )
maxj ! ( ... row addr )
swap ( ... addr row )
maxi ! ( ... addr )
0 icount !
begin
0 jcount !
icount @ maxi @ <
while
begin
jcount @ maxj @ <
while
0.0 ( ... addr 0.0 0.0 )
icount @ ( ... addr 0.0 0.0 icount )
jcount @ ( ... addr 0.0 0.0 icount jcount )
4 pick ( ... addr 0.0 0.0 icount jcount addr )
element 2! ( ... addr )
1 jcount +!
repeat
1 icount +!
repeat
drop ( ... )
;
\ Stack on entering: Stack on leaving:
: 1x33x3multiply ( ... addrv addrt ) ( ... )
0 icount !
begin
0 jcount !
0.0 ftmp 2!
icount @ 3 <
while
begin
jcount @ 3 <
while
jcount @ ( ... addrv addrt jcount )
icount @ ( ... addrv addrt jcount icount )
2 pick ( ... addrv addrt jcount icount addrt )
\ Get the i,j element from the 3x3 matrix.
element 2@ ( ... addrv addrt f1 f1 )
0 jcount @ ( ... addrv addrt f1 f1 0 jcount )
5 pick ( ... addrv addrt f1 f1 0 jcount addrv )
element 2@ ( ... addrv addrt f1 f1 f2 f2 )
f* ftmp 2@ f+ ( ... addrv addrt f3 f3 )
ftmp 2! ( ... addrv addrt )
1 jcount +!
repeat
ftmp 2@ ( ... addrv addrt f4 f4 )
0 icount @ ( ... addrv addrt f4 f4 0 icount )
result element 2! ( ... addrv addrt )
1 icount +!
repeat
drop drop ( ... )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -