乐筑天下

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

[编程交流] one-click override dimension w

[复制链接]

20

主题

257

帖子

237

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-5 23:50:39 | 显示全部楼层 |阅读模式
hi all
 
i want to be able to change a dimension to read "eq" or "equal" etc just by one click. i expect this is possible but i don't know how to do it.
 
at the moment i spend a lot of time typing "eq" when making lighting layouts and general setting out drawings. i would like to automate it, and have no preference between button or command.
 
if possible, change multiple dims together would also be handy.
 
thanks for any help
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:00:22 | 显示全部楼层
Try the following:
  1. (defun c:dimeq ( / e i s )   (if (setq s (ssget "_:L" '((0 . "*DIMENSION"))))       (repeat (setq i (sslength s))           (setq e (entget (ssname s (setq i (1- i)))))           (entmod (subst '(1 . "eq") (assoc 1 e) e))       )   )   (princ))
回复

使用道具 举报

20

主题

257

帖子

237

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:10:19 | 显示全部楼层
Lee Mac - the original and still the finest!
thank you, it is perfect for my needs. one of these days i will donate to your website. legend!
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:18:31 | 显示全部楼层
That's very kind of you Stuart, thank you
回复

使用道具 举报

20

主题

257

帖子

237

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:22:18 | 显示全部楼层
right, so this works like a charm, very pleased thanks lee!
 
now i want to do the opposite!
is it possible to remove dimension override text with a one-click function?
 
either select lots of dims, input command, and all dims are back to 'natural' state
or failing that, input command, pick a dim, it reverts to 'natural'
 
thanks all, most appreciated!
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 00:34:59 | 显示全部楼层
Please adjust this line:
  1. (entmod (subst '(1 . "[color=magenta][/color]") (assoc 1 e) e))   ;replace "eq" with ""
回复

使用道具 举报

1

主题

116

帖子

115

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 00:37:17 | 显示全部楼层
There are several options Stuart. You could use the routine that Lee gave you and change the text that it uses to either an empty string i.e. "" or the less than-greater than "".
 
as in
  1. (entmod (subst '(1 . "") (assoc 1 e) e))or(entmod (subst '(1 . "") (assoc 1 e) e))
 
Or alternatively the standard autocad command "dimedit" => "new" => "OK"
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-6 00:47:34 | 显示全部楼层
or even
 
command: Dim
n
(select all)
 
EDIT: oops  (look up ↑)
回复

使用道具 举报

20

主题

257

帖子

237

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:51:29 | 显示全部楼层
great chaps, thank you. i prefer the  option, that makes sense to me.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 21:30 , Processed in 0.704457 second(s), 70 queries .

© 2020-2025 乐筑天下

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