jhailey 发表于 2022-7-6 07:16:32

使用Au设置Dimstyle

我一直在使用上一个线程中的lisp例程,试图设置
使用autolisp的dimstyle。但我遇到了一个错误,不知道为什么或如何修复。
有人能帮忙吗?
谢谢
 
 
错误:
; 错误:输入时虚线对中有额外的CDR
 
代码:
 
(定义c:setdimstyle()
(命令“style”“ISO1”“simplex”“0”“1”“0”“n”“n”)
(如果(不是(tblsearch“DImstyle”“ISO1”))
(progn(命令“dimstyle”S“ISO1”)
 
 
(命令“dim”“style”“ISO1”
 
“DIMADEC”0
“DIMALT”关闭
“DIMALTD”2
“DIMALTF”25.4000
“DIMALTMZF”8'-4“
“DIMALTMZS”
“DIMALTRND”0”
“DIMALTTD”2
“DIMALTTZ”0
“DIMALTU”2
“DIMALTZ”0
“DIMAPOST”
“DIMARCSYM”0
“DIMASZ”1/16“
“DIMATFIT”3
“DIMAUNIT”0
“DIMAZIN”0
“DIMBLK”ISO1
“DIMBLK1”闭合填充
“DIMBLK2”闭合填充
“DIMCEN”1/16
“DIMCLRD”240
“DIMCLRE”240
“DIMCLRT”140
“DIMDEC”2
DIMDLE“0”
DIMDLI“0”
“DIMDSEP”。
“DIMEXE”1/16“
“DIMEXO”1/16“
“DIMFRAC”0
“DIMFXL”1“
“DIMFXLON”关闭
“DIMGAP”1/16
“DIMJOGANG”45.00
“DIMJUST”0
“DIMLDRBLK”闭合BLANK
“DIMLFAC”1.0000
“DIMLIM”关闭
“DIMLTEX1”BYBLOCK
“DIMLTEX2”BYBLOCK
“DIMLTYPE”连续
“DIMLUNIT”2
“DIMLWD”-2
“DIMLWE”-2
“DIMMZF”8'-4“
“DIMMZ”
“DIMPOST”
“DIMRND”0”
“DIMSAH”关闭
“DIMSCALE”1.0000
“DIMSD1”关闭
“DIMSD2”关闭
“DIMSE1”打开
“DIMSE2”开启
“DIMSOXD”关闭
“DIMTAD”1
“DIMTDEC”2
“DIMTFAC”1.0000
“DIMTFILL”0
“DIMTFILLCLR”BYBLOCK
“DIMTIH”关闭
“DIMTIX”关闭
“DIMTM”0”
“DIMTMOVE”0
“DIMTOFL”关闭
“DIMTOH”关闭
“DIMTOL”关闭
“DIMTOLJ”1
“DIMTP”0”
“DIMTSZ”0”
“DIMTVP”0.0000
“DIMTXSTY ISO1
“DIMTXT”0.09375“
“DIMTXTDIRECTIONOff”
“DIMTZIN”0
“DIMUPT”关闭
“DIMZIN”0\e)
(命令“dimstyle”“S”“ISO1”“Y”))(graphscr)(princ))

GP_ 发表于 2022-7-6 07:25:52

可能
 
“DIMTM”0”

tomhamlet 发表于 2022-7-6 07:32:50

从我对lisp所知的一点来看,您的文件看起来确实有点不一致,在一些参数上加了尾端引号,而不是像GP_所说的那样在其他参数上加了尾端引号。顺便说一句,如果你把它放在代码格式中,它会使你的代码更容易阅读和分析。只需点击#图标并在]和[

jhailey 发表于 2022-7-6 07:46:34

我纠正了“DIMTM”0,但它仍然给出了相同的错误。
代码是从另一个线程复制的,并与以前一样放置
除了设置图层外。
 
---
从我对lisp所知的一点来看,您的文件看起来确实有点不一致,在一些参数上加了尾端引号,而不是像GP_所说的那样在其他参数上加了尾端引号。顺便说一句,如果你把它放在代码格式中,它会使你的代码更容易阅读和分析。只需点击#图标并在]和[谢谢您的帮助]之间插入代码。
--
我不确定您在这里的意思,我检查了dimstyle列出的变量,并按照Autocad显示的方式复制了它们。据我所知,代码正确地放在括号内。希望你能进一步澄清这一点?
 
谢谢

jhailey 发表于 2022-7-6 07:47:42

我发现另一个线程有一个类似的线程。这一个似乎工作得更好,我想我可以修改这一个为我想要的。
 
“只需点击#图标并在]和[谢谢您的帮助]之间插入代码。”
谢谢Tomhamlet,我刚刚意识到了这一点,我正在考虑visual Lisp控制台。
 

(defun c:insertdim ()         
       (command "._style" "SIMPLEX" "SIMPLEX.SHX" "0" "1" "" "" "" "")
       (setvar "lunits" 4)
       (setvar "DIMASSOC" 1)
       (setq ds
       (list
         (cons 0 "DIMSTYLE")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbDimStyleTableRecord")
         (cons 2 "DIMTEST")    ;Dim style name
         (cons 70 0)   ;
         (cons 5 "ARCHTICK")    ;DIMBLK-Name of block instead of default arrowhead
         (cons 170 0)   ;DIMALT-turns off alternate units
         (cons 40 48)   ;DIMSCALE-sets the overall scale factor applied to all dimensions
         (cons 41 0.125)    ;DIMASZ-sets the size of the arrow/tick
         (cons 44 0.0625)    ;DIMEXE-specifies how far to extend the extention line beyound the dim line
         (cons 46 0)   ;DIMDLE-sets the distance the dimension line extends beyond the extension line
         (cons 73 0)   ;DIMTIH-controls the position of dimension text inside extention lines
         (cons 74 0)   ;DIMTOH-controls the position of dimension text outside extention lines
         (cons 77 1)   ;DIMTAD-controls the vertical position of text in relation to the dim line
         (cons 78 3)   ;DIMZIN-controls the suppression of zeros
         (cons 140 0.125)    ;DIMTXT-specifies the height of the text in the dim
         (cons 143 25.4)    ;DIMALTF-controls the scale factor for alt. units
         (cons 147 0.0625)    ;DIMGAP-sets the distance from around the dim text
         (cons 171 2)   ;DIMALTD-controls the decimal places for units
         (cons 172 0)   ;DIMTOFL-forces a line inside extension lines
         (cons 270 4)   ;DIMUNIT-sets the units format for all dims
         (cons 271 4)   ;DIMDEC-sets the number of decimal places of primary units
         (cons 273 2)   ;DIMALTU-sets the units for alt. units
         (cons 275 0)   ;DIMAUNIT-sets the angular format for angular dims
         (cons 280 0)   ;DIMJUST-controls the horizontal positioning of dim text
         (cons 286 0)   ;DIMALTTZ-Toggles the suppression in tolerance values
       )
)
(entmake ds)
(dimsave)
(princ)
)
(defun dimsave ()
(command "DIMSTYLE" "R" "DIMTEST")
(setvar "DIMTXSTY" "SIMPLEX")
(command "DIMSTYLE" "S" "DIMTEST" "Y")
)

tomhamlet 发表于 2022-7-6 07:55:02

 
没问题。

jhailey 发表于 2022-7-6 08:04:42

另一个问题:在哪里可以找到“(cons XX)到每个变量的(列表)变量定义?
再次感谢

Lee Mac 发表于 2022-7-6 08:10:18

 
现在没有太多时间来研究这个问题以提供一些示例,但以下是DIMSTYLE DXF参考:
 
http://exchange.autodesk.com/autocad/enu/online-help/browse#WS1a9193826455f5ff18cb41610ec0a2e719-7a53.htm

jhailey 发表于 2022-7-6 08:19:33

谢谢李,谢谢你!
页: [1]
查看完整版本: 使用Au设置Dimstyle