chenry676 发表于 2020-12-7 16:32:50

请教对齐标注怎样改为线性标注?是否有这样的功能(已解决)

本帖最后由 chenry676 于 2021-6-4 11:07 编辑

请教对齐标注怎样改为线性标注?是否有这样的功能。

panliang9 发表于 2020-12-8 08:43:31

(defun c:CDR (/ ss Ent EntData Pt1 Pt2 Pt3 ocmd omode olay odim)
; Redraw dimension that were drawn as aligned as rotated on correct layer,
and with correct dimension style.

(setq ocmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "_.undo" "_end")
(command "_.undo" "_begin")
(setq omode (getvar "osmode"))
(setvar "osmode" 0)
(setq olay (getvar "clayer"))
(setq odim (getvar "dimstyle"))
(if (setq ss (ssget '((0 . "DIMENSION"))))
(while (setq Ent (ssname ss 0))
(setq EntData (entget Ent))
(if (not (member '(100 . "AcDbRotatedDimension") EntData))
(progn
(setq Pt1 (cdr (assoc 13 EntData)))
(setq Pt2 (cdr (assoc 14 EntData)))
(setq Pt3 (cdr (assoc 11 EntData)))
(if (< (car Pt1) (car Pt2))
(command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2))
5))
(command "_.ucs" "_3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1))
5))
)
(setvar "clayer" (cdr (assoc 8 EntData)))
(command "_.dimstyle" "_r" (cdr (assoc 3 EntData)))
(entdel Ent)
(command "_.dim" "_horizontal" (trans Pt1 0 1) (trans Pt2 0 1) (trans
Pt3 0 1) "" "_exit")
(command "_.ucs" "_p")
)
)
(ssdel Ent ss)
)
)
(command "_.dimstyle" "_r" odim)
(command "_.undo" "_end")
(setvar "clayer" olay)
(setvar "osmode" omode)
(setvar "cmdecho" ocmd)
(princ)
)

chenry676 发表于 2020-12-8 19:49:33

虽然不是这个概念用不上,但还是感谢,已找到源泉插件有这个功能了。

e2002 发表于 2020-12-9 21:07:19

有。
我在本论坛也提出过这个问题,然后马上就给出了代码,我后面又改进了一些流程。

chenry676 发表于 2020-12-17 16:31:22

已经找到,源泉有这个功能。
页: [1]
查看完整版本: 请教对齐标注怎样改为线性标注?是否有这样的功能(已解决)