乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 79|回复: 3

[编程交流] 标注样式-如何居中

[复制链接]

44

主题

139

帖子

95

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
221
发表于 2022-7-5 18:14:29 | 显示全部楼层 |阅读模式
大家好!
 
我正试图将一段引语的文本居中:
从…起
191431y8nswcfqcotzlbss.jpg

191432uyfxbv5wxxb57e9y.jpg
 
我试图研究entget,但这两个实体之间没有区别。
  1. ((-1 . <Nome entità: 7ffffb0e3d0>) (0 . "DIMENSION")
  2.                                   (330 . <Nome entità: 7ffffb039f0>)
  3.                                   (5 . "164D")
  4.                                   (100 . "AcDbEntity")
  5.                                   (67 . 0)
  6.                                   (410 . "Model")
  7.                                   (8 . "QUOTE")
  8.                                   (100 . "AcDbDimension")
  9.                                   (2 . "*D33")
  10.                                   (10 3680.43 -890.552 0.0)
  11.                                   (11 3677.28 -890.552 0.0)
  12.                                   (12 0.0 0.0 0.0)
  13.                                   (70 . 33)
  14.                                   (1 . "")
  15.                                   (71 . 5)
  16.                                   (72 . 1)
  17.                                   (41 . 1.0)
  18.                                   (42 . 630.0)
  19.                                   (73 . 0)
  20.                                   (74 . 0)
  21.                                   (75 . 0)
  22.                                   (52 . 0.0)
  23.                                   (53 . 0.0)
  24.                                   (54 . 0.0)
  25.                                   (51 . 0.0)
  26.                                   (210 0.0 0.0 1.0)
  27.                                   (3 . "Quota_m")
  28.                                   (100 . "AcDbAlignedDimension")
  29.                                   (13 3674.13 -890.552 0.0)
  30.                                   (14 3680.43 -890.552 0.0)
  31.                                   (15 0.0 0.0 0.0)
  32.                                   (16 0.0 0.0 0.0)
  33.                                   (40 . 0.0)
  34.                                   (50 . 0.0)
  35. )

 
另一个小问题:有可能迫使这句话保持中心吗?
191433f7ozh51ooi59c07c.png
191434zue6epo6uzee6u5h.png
 
这就是我创建dimstyle的方式:
  1. (defun crea_stile_quota (/)
  2. (setq moltiplicatore 1.0
  3.        dimstylename "Quota_cm"
  4.        stile "Arial_cm")
  5. (repeat 2
  6. (setq dimscale (* 1 moltiplicatore)
  7.      Arrow_Size 10
  8.      Extension_Line_Origin_Offset 80
  9.      Dimension_Line_Spacing 37.5
  10.      Extension_Above_Dimension_Line 12.5
  11.      Text_Height 20
  12.      Center_Mark_Size 25
  13.      ;quote_scale (/ 1.0 (expt moltiplicatore 2))
  14.      quote_scale (/ 1.0 moltiplicatore)
  15.      Gap_From_dimension_Line_to_Text 9
  16.      Decimal_Places 0
  17.      Tolerance_Decimal_places 0
  18.      Text_Movement 0
  19.      )
  20. (setq ds
  21. (list
  22. (cons 0 "DIMSTYLE")
  23. (cons 100 "AcDbSymbolTableRecord")
  24. (cons 100 "AcDbDimStyleTableRecord")
  25. (cons 2 dimstylename) ;Dim style name
  26. (cons 70 0) ; Standard flag
  27. (cons 3 ""); DIMPOST
  28. (cons 4 ""); DIMAPOST
  29. (cons 5 "") ;DIMBLK-Name of block instead of default arrowhead
  30. (cons 6 "");(cons 6 "ClosedFilled"); DIMBLK1
  31. (cons 7 "");(cons 7 DIMBLK-Name); DIMBLK2
  32. (cons 170 0) ;DIMALT-turns off alternate units
  33. (cons 40 dimscale) ;DIMSCALE-sets the overall scale factor applied to all dimensions
  34. (cons 41 Arrow_Size) ;DIMASZ-sets the size of the arrow/tick
  35. (cons 42 Extension_Line_Origin_Offset); DIMEXO
  36. (cons 43 Dimension_Line_Spacing); DIMDLI
  37. (cons 44 Extension_Above_Dimension_Line) ;DIMEXE-specifies how far to extend the extention line beyound the dim line
  38. (cons 45 0.0); DIMRND
  39. (cons 46 0) ;DIMDLE-sets the distance the dimension line extends beyond the extension line
  40. (cons 47 0.0); DIMTP
  41. (cons 48 0.0); DIMTM
  42. (cons 71 0); DIMTOL
  43. (cons 72 0); DIMLIM
  44. (cons 73 0) ;DIMTIH-controls the position of dimension text inside extention lines ;METTE        IL TESTO DI QUOTA ORIZZONTALE
  45. (cons 74 0) ;DIMTOH-controls the position of dimension text outside extention lines
  46. (cons 75 1); DIMSE1 ;1 sopprime la linea di estensione, 0 la lascia
  47. (cons 76 1); DIMSE2 ;1 sopprime la linea di estensione, 0 la lascia
  48. (cons 77 1) ;DIMTAD-controls the vertical position of text in relation to the dim line
  49. (cons 78  ;DIMZIN-controls the suppression of zeros
  50. (cons 79 1); DIMAZIN
  51. (cons 140 Text_Height) ;DIMTXT-specifies the height of the text in the dim
  52. (cons 141 Center_Mark_Size); DIMCEN
  53. (cons 142 0.0); DIMTSZ
  54. (cons 143 0.5) ;DIMALTF-controls the scale factor for alt. units
  55. (cons 144 quote_scale); DIMLFAC ;scala di quota
  56. (cons 145 0.0); DIMTVP
  57. (cons 146 1.0); DIMTFAC
  58. (cons 147 Gap_From_dimension_Line_to_Text) ;DIMGAP-sets the distance from around the dim text
  59. (cons 170 0); DIMALT
  60. (cons 171 3) ;DIMALTD-controls the decimal places for units
  61. (cons 172 1) ;DIMTOFL-forces a line inside extension lines
  62. (cons 173 0); DIMSAH
  63. (cons 174 0); DIMTIX
  64. (cons 175 0); DIMSOXD
  65. (cons 176 256); DIMCLRD
  66. (cons 177 0); DIMCLRE
  67. (cons 178 1); DIMCRRT
  68. (cons 179 0); DIMADEC
  69. (cons 270 2) ;DIMUNIT-sets the units format for all dims ;2 decimale ; 4architettonico
  70. (cons 271 Decimal_Places) ;DIMDEC-sets the number of decimal places of primary units
  71. (cons 272 Tolerance_Decimal_places); DIMTDEC
  72. (cons 273 2) ;DIMALTU-sets the units for alt. units
  73. (cons 275 0) ;DIMAUNIT-sets the angular format for angular dims
  74. (cons 276 1); DIMFRAC
  75. (cons 277 2); DIMLUNIT ;2 decimale ; 4architettonico
  76. (cons 278 0); DIMDSEP
  77. (cons 279 Text_Movement); DIMTMOVE
  78. (cons 280 0) ;DIMJUST-controls the horizontal positioning of dim text
  79. (cons 281 0); DIMSD1
  80. (cons 282 0); DIMSD2
  81. (cons 283 1); DIMTOLJ
  82. (cons 284 3); DIMTZIN
  83. (cons 285 1); DIMALTZ
  84. (cons 286 0) ;DIMALTTZ-Toggles the suppression in tolerance values
  85. ;(cons 287 0); DIMFIT
  86. ;(cons 288 0); DIMUPT
  87. ;(cons 289 0); DIMATFIT
  88. (cons 340 (tblobjname "style" stile)); DIMTXSTY
  89. ;(cons 341 (cdr (assoc 330 (entget (tblobjname "block" "."))))); DIMLDRBLK
  90. ;(cons 342 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK
  91. ;(cons 343 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK1
  92. ;(cons 344 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK2
  93. ;(cons 371 -2); DIMLWD
  94. ;(cons 372 -2); DIMLWE
  95. )
  96.      )
  97.    (entmake ds)
  98.    (setq moltiplicatore 0.01
  99.          dimstylename "Quota_m"
  100.          stile "Arial_m")
  101. )
  102. (setq moltiplicatore 1.0)
  103. )

谢谢
丹尼斯
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 18:35:07 | 显示全部楼层
作为标注样式替代(即基于每个标注):
  1. (defun c:test ( / sel tmp xdl )
  2.    (if (setq sel (ssget "_+.:E:S:L" '((0 . "*DIMENSION"))))
  3.        (progn
  4.            (cond
  5.                (   (null (setq xdl (cadr (assoc -3 (entget (ssname sel 0) '("ACAD"))))))
  6.                    (setq xdl
  7.                       '(
  8.                            "ACAD"
  9.                            (1000 . "DSTYLE")
  10.                            (1002 . "{")
  11.                            (1070 . 77)
  12.                            (1070 . 0)
  13.                            (1002 . "}")
  14.                        )
  15.                    )
  16.                )
  17.                (   (setq tmp (member '(1070 . 77) xdl))
  18.                    (setq xdl
  19.                        (append
  20.                            (reverse (cdr (member '(1070 . 77) (reverse xdl))))
  21.                           '((1070 . 77) (1070 . 0))
  22.                            (cddr tmp)
  23.                        )
  24.                    )
  25.                )
  26.                (   (setq xdl
  27.                        (reverse
  28.                            (vl-list*
  29.                               '(1002 . "}")
  30.                               '(1070 . 0)
  31.                               '(1070 . 77)
  32.                                (cdr (reverse xdl))
  33.                            )
  34.                        )
  35.                    )
  36.                )
  37.            )
  38.            (entmod (append (entget (ssname sel 0)) (list (list -3 xdl))))
  39.        )
  40.    )
  41.    (princ)
  42. )

 
作为全局标注样式设置:
  1. (cons 77 [highlight]0[/highlight]) ;DIMTAD-controls the vertical position of text in relation to the dim line
回复

使用道具 举报

44

主题

139

帖子

95

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
221
发表于 2022-7-5 19:09:42 | 显示全部楼层
谢谢李先生!
 
对第二项任务有什么建议吗?
我想把引号放在二维端点的中心,如图所示。
 
谢谢
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 19:23:57 | 显示全部楼层
 
不客气!
 
 
我相信你可以解决这个问题
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 19:43 , Processed in 1.139878 second(s), 63 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表