乐筑天下

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

[编程交流] 属性编辑旋转/移动Glo

[复制链接]

2

主题

439

帖子

536

银币

限制会员

铜币
-14
发表于 2022-7-6 15:02:14 | 显示全部楼层
也许 吧:
 
  1. (defun c:atrot(/ blSet attLst errCount oldAng)
  2. (if(not atrot:rAng)(setq atrot:rAng 0))
  3. (setq oldAng atrot:rAng
  4.        atrot:rAng
  5. (getangle
  6.    (strcat "\nSpecify rotation angle <"(angtos atrot:rAng)">: ")))
  7. (if(not atrot:rAng)(setq atrot:rAng oldAng))
  8. (princ "<<< Select blocks to rotate attributes >>>")
  9. (setq errCount 0)
  10. (if
  11.    (setq blSet(ssget '((0 . "INSERT")(66 . 1))))
  12.    (progn
  13.      (setq blSet(mapcar 'vlax-ename->vla-object
  14.                    (vl-remove-if 'listp
  15.                     (mapcar 'cadr(ssnamex blSet)))))
  16.      (foreach itm blSet
  17. (setq attLst
  18.        (vlax-safearray->list
  19.          (vlax-variant-value
  20.            (vla-GetAttributes itm))))
  21. (foreach att attLst
  22.   (if(vl-catch-all-error-p
  23.            (vl-catch-all-apply
  24.              'vla-put-Rotation(list att atrot:rAng)))
  25.     (setq errCount(1+ ErrCount))
  26.           ); end if
  27.   ); end foreach
  28. ); end foreach
  29.      ); end progn
  30.    (princ ">>> Nothing selected! <<<")
  31.    ); end if
  32. (if(/= 0 errCount)
  33.    (princ
  34.      (strcat "\n>>> "
  35. (itoa errCount)
  36.       " attributes or blocks were on locked layer! <<< "))
  37.       ); end if
  38. (princ)
  39. ); end of c:atrot

---
编辑:哎呀,我迟到了。。。
回复

使用道具 举报

11

主题

117

帖子

133

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 15:05:27 | 显示全部楼层
嗨,阿斯米,我经常使用你的Lisp程序(下面),谢谢你的帮助,我很高兴!
 
我认为在我的情况下,它可以修改,这样可以节省更多的时间。可以这样修改吗
(我的意思是“你”能做到吗…?因为我不能…)
 
1.atrot命令后,acad提示属性的旋转角度。我想跳过这个问题,使用0(零)度。我从不使用其他价值观。我想这对你们来说并不难。
 
2、输入所需的度数后,建议选择块。然后对所有属性使用0度。这不应该发生:我想指定某个标记设置为零。由于我的各个区块都有相同的标签,它将完全满足我的需要。
 
我会在菜单中保留原来的lisp,因为它可能会在某个时候派上用场。
回复

使用道具 举报

10

主题

253

帖子

75

银币

后起之秀

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

铜币
223
发表于 2022-7-6 15:09:54 | 显示全部楼层
或者其他人。。?
回复

使用道具 举报

59

主题

327

帖子

268

银币

后起之秀

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

铜币
295
发表于 2022-7-6 15:11:09 | 显示全部楼层
试一试:
 
[code]defunc:atrot[color=blSet attLst errCount tmp[color=BLUE b]#ff00ff]setq[color]tmpgetstring[color][RED]([color=BLUE strcat[color][ff00ff]“\n指定要旋转的标记:“eqtmpsetqatrot:标记tmp[color=BLUE princ color][color=BLUE b]35;ff00ff]“>”setq[color]errCount0[color][color=blSet[color=blSet b][color=BLUE ssget][color]'color([/color0[/color . “插入”661[/color b][/color b]蓝色]prognsetqblSetmapcar'vlax ename->vla对象[color=BLUE vl remove if'[color=BLUE listp[color=BLUE'cadrssnamexblSet[color=RED 4][color=blSet[color=blSetsetqattLstvlax安全阵列->列表vlax变量值[color=BLUE vla GetAttributes][color]itmforeachattLst[color=BLUE eq[color=BLUE eq[color=BLUE coloratrot:tag[/colorvla get TagStringattatrot:tag[color]vla get TagStringatt b][color=RED b][color=RED(vl-catch-all-error-pvl catch-all apply'vla put Rotation[color=RED listatt b]0.0[color=RED b]setq[color]errCount/color]princ[/color“>>>未选择任何内容!”itoaerrCount“属性或块位于锁定层!
回复

使用道具 举报

59

主题

327

帖子

268

银币

后起之秀

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

铜币
295
发表于 2022-7-6 15:16:49 | 显示全部楼层
李:贾沃尔。。。我的意思是,是的,它工作得很好。
在“编辑”菜单中做了一些宏,我很高兴!!
 
这节省了我很多时间。。。
 
我的问题是,我有足够的想法,但我不能写vba或lisp,尽管我每天晚上阅读和尝试了所有。。
 
谢谢你帮我。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:20:04 | 显示全部楼层
 
 
别担心。
 
我的问题是我对LISP程序没有足够的想法
回复

使用道具 举报

59

主题

327

帖子

268

银币

后起之秀

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

铜币
295
发表于 2022-7-6 15:20:40 | 显示全部楼层
Lee Mac: jawohl ... I mean, yes it works very good.
Made a few macro's in the "edit" menu and I'm very happy !!
 
This saves me a lot of time...
 
My problem is that i have ideas enough but i can't write vba or lisp allthough i read and try allmost every evening..
 
Thank you for helping me out.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:23:29 | 显示全部楼层
 
 
No worries.
 
My problem is that I don't have enough ideas for LISP programs, as I don't use CAD... I just do the coding
回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 15:29:02 | 显示全部楼层
Hi, thanks for this really great comand!!!
 
The angel 0 in this comand is relative to ucs world, even if my drawing uses a diffrent ucs... is it posible to change the angel to be relative to the current ucs instead?
 
(sorry for my bad english - i hope you understand me anyway...)
回复

使用道具 举报

4

主题

22

帖子

18

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 15:29:59 | 显示全部楼层
Hello guys!
I have not been able to get this lisp to work and I really need it!
When I call the ATROT command, I get the propmt for the tag to be rotated. What am I suppose to type here? What "all" does? I have tryed typing the name of any of the attribute tags on the block I would like to rotate to zero but no luck. This is what I keep getting:
 
Command: ATROT
Specify Tag to be Rotated : S
>>
Select objects: 1 found
Select objects:
; error: no function definition: nil
 
Please Help!
 
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 00:18 , Processed in 0.465577 second(s), 81 queries .

© 2020-2025 乐筑天下

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