本帖最后由 Nico 于 2024-1-19 22:31 编辑
怎么判断对象是引线?
引线+多行文字组成了引线,
怎么判断这个多行文字是与引线捆绑的?
哪位大神帮写个代码,我想把甩有标注对象 (含引线)转到 dim 图层上
- (defun c:gtz1 ();得到块内对象,第一层级;要
- (vl-load-com)
- (princ "\n速度有点慢慢 请稍等")
- (if (setq ss (ssget (list '(0 . "INSERT"))))
- (repeat (setq sslen (sslength ss))
- (setq ename (ssname ss (setq sslen (1- sslen))))
- (setq enlast1 (tblobjname "block" (cdr (assoc 2 (entget ename)))))
- (setq tz_dim "dim")
- (setq tz_txt "A文字")
- (while (setq enlast1 (entnext enlast1))
-
-
- ;改单行文字到文字层
- (if (or (= nema1 "AcDbMText") (= nema1 "AcDbText") );
- (progn
- (if (= nema1 "AcDbText")
- (princ "\n单行文字")
- ;;; (princ (Vlax-Get (Vlax-Ename->Vla-Object enlast1) 'TextString));为什么会错 'TextString
-
- )
-
- (Vlax-Put-Property (Vlax-Ename->Vla-Object enlast1) 'Layer tz_txt);放到指定图层
- ;;; (command "REGEN") ;重画一下
- )
- )
- ;改对象到标注层
- (setq nema1 (Vlax-Get (Vlax-Ename->Vla-Object enlast1) 'ObjectName ))
- (if (or (= nema1 "AcDbRotatedDimension") (= nema1 "AcDbAlignedDimension") (= nema1 "AcDbRadialDimension"));
- (progn
-
- (Vlax-Put-Property (Vlax-Ename->Vla-Object enlast1) 'Layer tz_dim);放到指定图层
-
- )
- )
- ;;; (princ (car (entget enlast1)))
- ;;; (princ "\n")
- )
- )
- )
- (command "REGEN") ;重画一下
- (princ)
- )
哪里写的不对,单行文字有时也不转换,
|