获取名称动态块
如果我尝试获取动态块的名称。我的代码返回“*U65”,但名称是字符串。样品块试验代码
(setq selpline (ssget '((0 . "INSERT"))))
(setq i 0)
(setq nomeblk "")
(setq valor_ant "")
(setq valor "")
(setq sn "")
(setq contador 0 )
(repeat (sslength selpline)
(setq entblk (ssname selpline i))
(setq nomeblk (cdr(assoc 2 (entget entblk))))
(setq layer (cdr(assoc 8 (entget entblk))))
(print nomeblk)
(setq i (+ i 1))
)
有什么帮助吗?? 我找到小费了!
http://forums.augi.com/showthread.php?51593-LISP中是否有动态块的名称
(defun getblockname (blk / res)
(if blk
(progn
(if (= (type blk) 'ename)
(setq blk (vlax-ename->vla-object blk))
) ;_ end of if
(setq res (if (vlax-property-available-p blk 'effectivename)
(vla-get-effectivename blk)
(vla-get-name blk)
) ;_ end of if
) ;_ end of setq
) ;_ end of progn
) ;_ end of if
) ;_ end of defun
(getblockname (car (entsel))
在本页中,我还提供了使用Visual LISP和Vanilla AutoLISP的解决方案(用于解释Unicode块名)。
页:
[1]