明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1004|回复: 6

[提问] 如何修改属性快中的字高?

[复制链接]
发表于 2015-9-29 09:39 | 显示全部楼层 |阅读模式
1明经币
    如何修改属性快中的字高?能批量最好,因为该了一个 好像用刷子不能刷!下面是测试文件!

附件: 您需要 登录 才可以下载或查看,没有账号?注册
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2015-9-29 16:46 | 显示全部楼层
;;更改块的指定属性的高度
;; (choneheight ent "图纸名称1" 400)
(defun choneheight ( ent tagname tagheight / blkobj atts tag )
        (setq blkobj (vlax-ename->vla-object ent))
        (if (and
                        (= (vla-get-hasattributes blkobj) :vlax-true)
                        (safearray-value (setq        atts (vlax-variant-value (vla-getattributes blkobj))))
                )
                (foreach tag (vlax-safearray->list atts)
                        (if (= (strcase tagname) (strcase (vla-get-tagstring tag)))
                                (vla-put-height tag tagheight)
                        )
                )
                (vla-update blkobj)
        )
        (vlax-release-object blkobj)
)
回复

使用道具 举报

 楼主| 发表于 2015-9-29 17:06 | 显示全部楼层
masterlong 发表于 2015-9-29 16:46
;;更改块的指定属性的高度
;; (choneheight ent "图纸名称1" 400)
(defun choneheight ( ent tagname tag ...

好像不行!!!!
回复

使用道具 举报

发表于 2015-9-30 11:48 | 显示全部楼层
spp_wall 发表于 2015-9-29 17:06
好像不行!!!!

二楼程序没问题,是你的属性块有问题,试试 (choneheight (car (entsel)) "图号" 400)
回复

使用道具 举报

 楼主| 发表于 2015-9-30 11:58 | 显示全部楼层
mj0000 发表于 2015-9-30 11:48
二楼程序没问题,是你的属性块有问题,试试 (choneheight (car (entsel)) "图号" 400)

如果要批量选择 应该怎么改呢?
回复

使用道具 举报

发表于 2015-9-30 12:05 | 显示全部楼层
spp_wall 发表于 2015-9-30 11:58
如果要批量选择 应该怎么改呢?

遍历递归哈

看你在论坛也呆了蛮久了, 要学会自个儿动手哈
回复

使用道具 举报

发表于 2015-9-30 13:34 | 显示全部楼层
  1. ;; 改属性快字高  需要e派工具箱(XCAD)的支持
  2. (defun c:test1732 ()
  3.   (xyp-Start)
  4.   (setq th (UREAL 7 "" "字高" th))
  5.   (setq i -1)
  6.   (if (setq ss (ssget '((0 . "insert") (66 . 1))))
  7.     (while (setq s1 (ssname ss (setq i (1+ i))))
  8.       (setq lst        (xyp-Att2list s1)
  9.             lst        (mapcar 'car lst)
  10.       )
  11.       (mapcar '(lambda (x) (xyp-put "height" x th)) lst)
  12.     )
  13.   )
  14.   (xyp-End)
  15. )
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 15:23 , Processed in 0.443521 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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