MastroLube 发表于 2022-7-5 18:31:26

DimensionStyle entmake问题

大家好,我有一个关于entmaking Dimensionstyle的小问题。
我有意大利版的autocad 2016
 
(setq dimscale (* 1.0 moltiplicatore)
   Arrow_Size (* 1.5 moltiplicatore)
   Extension_Line_Origin_Offset (* 8.0 moltiplicatore)
   Dimension_Line_Spacing (* 3.75 moltiplicatore)
   Extension_Above_Dimension_Line (* 1.25 moltiplicatore)
   Text_Height (* 2.2 moltiplicatore)
   Center_Mark_Size (* 2.5 moltiplicatore)
   quote_scale 10.0)
   Gap_From_dimension_Line_to_Text (* 0.9 moltiplicatore)
   Decimal_Places 0
   Tolerance_Decimal_places 0
   Text_Movement 0
   )
(setq ds
(list
(cons 0 "DIMSTYLE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbDimStyleTableRecord")
(cons 2 dimstylename) ;Dim style name
(cons 70 0) ; Standard flag
(cons 3 ""); DIMPOST
(cons 4 ""); DIMAPOST
(cons 5 "_Oblique") ;DIMBLK-Name of block instead of default arrowhead
(cons 6 "_Oblique");(cons 6 "ClosedFilled"); DIMBLK1
(cons 7 "_Oblique");(cons 7 DIMBLK-Name); DIMBLK2
(cons 170 0) ;DIMALT-turns off alternate units
(cons 40 dimscale) ;DIMSCALE-sets the overall scale factor applied to all dimensions
(cons 41 Arrow_Size) ;DIMASZ-sets the size of the arrow/tick
(cons 42 Extension_Line_Origin_Offset); DIMEXO
(cons 43 Dimension_Line_Spacing); DIMDLI
(cons 44 Extension_Above_Dimension_Line) ;DIMEXE-specifies how far to extend the extention line beyound the dim line
(cons 45 0.0); DIMRND

(cons 46 0) ;DIMDLE-sets the distance the dimension line extends beyond the extension line

(cons 47 0.0); DIMTP
(cons 48 0.0); DIMTM

(cons 71 0); DIMTOL
(cons 72 0); DIMLIM

(cons 73 0) ;DIMTIH-controls the position of dimension text inside extention lines ;METTE        IL TESTO DI QUOTA ORIZZONTALE
(cons 74 0) ;DIMTOH-controls the position of dimension text outside extention lines
(cons 75 1); DIMSE1 ;1 sopprime la linea di estensione, 0 la lascia
(cons 76 1); DIMSE2 ;1 sopprime la linea di estensione, 0 la lascia
(cons 77 1) ;DIMTAD-controls the vertical position of text in relation to the dim line
(cons 78;DIMZIN-controls the suppression of zeros
(cons 79 1); DIMAZIN
(cons 140 Text_Height) ;DIMTXT-specifies the height of the text in the dim
(cons 141 Center_Mark_Size); DIMCEN
(cons 142 0.0); DIMTSZ
(cons 143 0.5) ;DIMALTF-controls the scale factor for alt. units
(cons 144 quote_scale); DIMLFAC ;scala di quota
(cons 145 0.0); DIMTVP
(cons 146 1.0); DIMTFAC
(cons 147 Gap_From_dimension_Line_to_Text) ;DIMGAP-sets the distance from around the dim text
(cons 170 0); DIMALT
(cons 171 3) ;DIMALTD-controls the decimal places for units
(cons 172 1) ;DIMTOFL-forces a line inside extension lines

(cons 173 0); DIMSAH
(cons 174 0); DIMTIX
(cons 175 0); DIMSOXD
(cons 176 256); DIMCLRD
(cons 177 0); DIMCLRE
(cons 178 1); DIMCRRT
(cons 179 0); DIMADEC

(cons 270 2) ;DIMUNIT-sets the units format for all dims ;2 decimale ; 4architettonico
(cons 271 Decimal_Places) ;DIMDEC-sets the number of decimal places of primary units
(cons 272 Tolerance_Decimal_places); DIMTDEC
(cons 273 2) ;DIMALTU-sets the units for alt. units
(cons 275 0) ;DIMAUNIT-sets the angular format for angular dims
(cons 276 1); DIMFRAC
(cons 277 2); DIMLUNIT ;2 decimale ; 4architettonico
(cons 278 0); DIMDSEP
(cons 279 Text_Movement); DIMTMOVE
(cons 280 0) ;DIMJUST-controls the horizontal positioning of dim text
(cons 281 0); DIMSD1
(cons 282 0); DIMSD2
(cons 283 1); DIMTOLJ
(cons 284 3); DIMTZIN
(cons 285 1); DIMALTZ
(cons 286 0) ;DIMALTTZ-Toggles the suppression in tolerance values
;(cons 287 0); DIMFIT
;(cons 288 0); DIMUPT
;(cons 289 0); DIMATFIT
(cons 340 (tblobjname "style" "STANDARD")); DIMTXSTY
;(cons 341 (cdr (assoc 330 (entget (tblobjname "block" "."))))); DIMLDRBLK
;(cons 342 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK
;(cons 343 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK1
;(cons 344 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK2
;(cons 371 -2); DIMLWD
;(cons 372 -2); DIMLWE
)
   )
   (entmake ds)
 
我总是得到箭头!唯一的方法是编辑变量dimblk、dimblk1、dimblk2。
 
错误在哪里?
谢谢,丹尼斯

Lt Dan's l 发表于 2022-7-5 18:44:19

创建所需的对象,然后使用。
 
http://www.cadtutor.net/forum/showthread.php?94028-LISP表示取消(&p=643826&viewfull=1#post643826)

MastroLube 发表于 2022-7-5 19:06:47

你好
 
嗯!这看起来是一个很棒的工具!但它是否适用于引号?
 
如果清除,我将无法再创建报价!
(entmakex
(list
   (cons 0 "DIMENSION")
   (cons 100 "AcDbEntity")
   (cons 67 0)
   (cons 410 "Model")
   (cons 8 "0")
   (cons 100 "AcDbDimension")
   (cons 280 0)
   (cons 2 "*D136")
   (cons 10 '(5378.66 2125.34 0.0))
   (cons 11 '(5359.45 2020.34 0.0))
   (cons 12 '(0.0 0.0 0.0))
   (cons 70 32)
   (cons 1 "")
   (cons 71 5)
   (cons 72 1)
   (cons 41 1.0)
   (cons 42 210.0)
   (cons 73 0)
   (cons 74 0)
   (cons 75 0)
   (cons 52 0.0)
   (cons 53 0.0)
   (cons 54 0.0)
   (cons 51 0.0)
   (cons 210 '(0.0 0.0 1.0))
   (cons 3 "Quota_cm")
   (cons 100 "AcDbAlignedDimension")
   (cons 13 '(5428.66 1915.34 0.0))
   (cons 14 '(5428.66 2125.34 0.0))
   (cons 15 '(0.0 0.0 0.0))
   (cons 16 '(0.0 0.0 0.0))
   (cons 40 0.0)
   (cons 50 1.5708)
   (cons 100 "AcDbRotatedDimension")
)
)
 
有什么建议吗?

Lt Dan's l 发表于 2022-7-5 19:12:42

也许你可以使用/修改这个?这是我用的。
 
 

(defun AddDimLinear ( p1 p2 ang offset text layer flag / e )
(setq e
   (entmakex
   (list
       (cons 0   "DIMENSION")
       (cons 100"AcDbEntity")
       (cons 410"Model")
       (cons 8    layer)
       (cons 100"AcDbDimension")
       (cons 10(polar p1 (+ (* pi 0.5) ang) offset))
       (cons 11(trans (list (car p2)(cadr p2) 0.0) 1 0))
       (cons 70   32)
       (cons 1    text)
       (cons 42(distance p1 p2))
       (cons 53 ang)
       (cons 3    "STANDARD")
       (cons 100"AcDbAlignedDimension")
       (cons 13 (trans (list (car p1)(cadr p1) 0.0) 1 0))
       (cons 14 (trans (list (car p2)(cadr p2) 0.0) 1 0))
       (cons 50 ang)
       (cons 100 "AcDbRotatedDimension")
       (list -3
    (list "ACAD"
    (cons 1000 "DSTYLE")
    (cons 1002 "{")
    (cons 1070279)
    (cons 10701)
    (cons 107040)
    (cons 104032.0)
    (cons 107041)
    (cons 10400.1875)
    (cons 107042)
    (cons 1040(getvar 'dimexo))
    (cons 107043)
    (cons 10400.375)
    (cons 107044)
    (cons 10400.0625)
    (cons 107078)
    (cons 10703)
    (cons 1070140)
    (cons 10400.09375)
    (cons 1070141)
    (cons 10400.09375)
    (cons 1070147)
    (cons 10400.046875)
    (cons 1070173)
    (cons 10701)
    (cons 1070178)
    (cons 1070256)
    (cons 1070273)
    (cons 10704)
    (cons 1070277)
    (cons 10704)
    (cons 1070284)
    (cons 10703)
    (cons 1070285)
    (cons 10703)
    (cons 1070286)
    (cons 10703)
    (cons 1070289)
    (cons 10700)
    (cons 1070340)
    (cons 1005"39")
    (cons 1070341)
    (cons 1005"6D9")
    (cons 1070343)
    (cons 1005"6D9")
    (cons 1070344)
    (cons 1005"6D9")
         (cons 1002 "}")
         )
       )
   )
   )
)
(if (and e flag)
   (vlax-ename->vla-object e) e
)
)

 
(adddimlinear
(setq p1 (getpoint "\nSpecify first point: "))          ;P1 or first point
(setq p2 (getpoint p1 "\nSpecify second point: ")) ;p2 or second point
(angle p1 p2) ;angle
12. ;offset from first point
"" ;text override. you can also use "<> blah"
(getvar 'clayer) ;layer
nil ;t-return vla-object, nil return entity name
)


kpblc 发表于 2022-7-5 19:19:53

您可以尝试将var dimblk设置为所需的值,然后将其返回。然后可以创建尺寸样式。

MastroLube 发表于 2022-7-5 19:32:15

是的,我必须在(命令“-dimstyle”“\u restore”“Quota\u cm”)后面放一个setvar,它可以工作。。
无论如何即使报价很小,也有可能迫使报价保持在中间吗?
看看我录制的这个小gif:https://www.dropbox.com/s/qu5clb9y29hx0ay/quote.gif?dl=0
 
谢谢
页: [1]
查看完整版本: DimensionStyle entmake问题