明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1094|回复: 4

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

[复制链接]
发表于 2020-12-7 16:32:50 | 显示全部楼层 |阅读模式
本帖最后由 chenry676 于 2021-6-4 11:07 编辑

请教对齐标注怎样改为线性标注?是否有这样的功能。
发表于 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)
)
 楼主| 发表于 2020-12-8 19:49:33 | 显示全部楼层
虽然不是这个概念用不上,但还是感谢,已找到源泉插件有这个功能了。
发表于 2020-12-9 21:07:19 | 显示全部楼层
有。
我在本论坛也提出过这个问题,然后马上就给出了代码,我后面又改进了一些流程。
 楼主| 发表于 2020-12-17 16:31:22 | 显示全部楼层
已经找到,源泉有这个功能。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 12:56 , Processed in 0.140572 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表