寒潮大冬瓜
发表于 2024-6-19 19:57:33
院长好!我用“(xyp-SubUpd ss 41 st41)”函数来缩放属性cass块,普通块没问题,只是这个cass属性高程点块的文字没变化,期待院长指导指导……
xyp1964
发表于 2024-6-19 22:44:01
寒潮大冬瓜 发表于 2024-6-19 19:57
院长好!我用“(xyp-SubUpd ss 41 st41)”函数来缩放属性cass块,普通块没问题,只是这个cass属性高程点块 ...
(defun c:tt ()
(if (and (setq s0 (car (entsel "\n选择参照图块: ")))
(setq ss (ssget '((0 . "INSERT"))))
)
(progn
(setq d41 (xyp-DXF 41 s0)
i -1
)
(while (setq s1 (ssname ss (setq i (1+ i))))
(setq d41a (xyp-DXF 41 s1)
sc (/ d41 d41a1.)
)
(xyp-ScaleEntity s1 (xyp-DXF 10 s1) sc)
)
)
)
(princ)
)
寒潮大冬瓜
发表于 2024-6-20 10:11:14
本帖最后由 寒潮大冬瓜 于 2024-6-20 10:12 编辑
xyp1964 发表于 2024-6-19 22:44
感谢院长指导!
;【e派】工具箱函数再揭秘及应用实例
;http://bbs.mjtd.com/forum.php?mo ... 5673&fromuid=418631
;(出处: 明经CAD社区)
;
;xyp1964发表于 2024-6-19 22:44 | 只看该作者
;寒潮大冬瓜 发表于 2024-6-19 19:57
;院长好!我用“(xyp-SubUpd ss 41 st41)”函数来txyp2024-6-19缩放属性cass块普通块xyp1964于2024-6-19没问题,只是这个cass属性高程点块 ...
;txyp2024-6-19缩放属性cass块普通块xyp1964于2024-6-19
(defun c:txyp2024-6-19()
(if(and(setq s0(car(entsel "\n选择参照图块: ")))
(setq ss(ssget '((0 . "INSERT"))))
)
(progn
(setq d41(xyp-DXF 41 s0)
i -1
)
(while(setq s1(ssname ss(setq i(1+ i))))
(setq d41a(xyp-DXF 41 s1)
sc(/ d41 d41a1.)
)
(xyp-ScaleEntity s1(xyp-DXF 10 s1) sc)
)
)
)
(princ)
)
;没有最好,只有更好!e派系统(XCAD)QQ群下载:24942984
命令: (progn (load "C:/XCAD/txyp2024-6-19缩放属性cass块普通块xyp1964于2024-6-19.lsp")(princ))
Error: undefined function - ENTSEL?
可能是我的XCAD版本没更新,还没有“ ENTSEL”这个函数
yerenyi
发表于 2024-6-20 21:21:56
无条件顶,院长的源码那是必须学习滴
nuan1989
发表于 2024-6-21 03:12:15
厉害:lol:victory:
寒潮大冬瓜
发表于 2024-7-22 00:11:56
院长好!辛苦指导一下这个“RENAME”命令的插件,为何实现不了?
;求rename命令增强版
;http://bbs.mjtd.com/forum.php?mod=viewthread&tid=108144&fromuid=418631
;(出处: 明经CAD社区)
renall增强版rename命令andyding于2023-7-4明经
寒潮大冬瓜
发表于 2024-8-18 00:30:11
本帖最后由 寒潮大冬瓜 于 2024-8-18 00:31 编辑
院长好!我用XYP-DXF1964和xyp-MkLaCo函数整了个获取起点10的坐标继续画线的代码,辛苦院长指导
感觉还不够顺……
;FX获取直线圆块样条曲线多段线等图元10起点画线XYP-DXF1964和xyp-MkLaCo函数
(defun c:FX(/ k e i p pp s)
(setq k(car(entsel)))
(setq p(xyp-DXF1964 10 K))
(setq kTCM0(xyp-DXF1964 8 K))
(SETQ kTCM(strcat kTCM0 "FX-" (menucmd "M=$(edtime,$(getvar,date),YYYYMODDhh)") ))
(xyp-MkLaCo kTCM 2)
(COMMAND "LINE" p PAUSE "")
(setvar "CMDECHO" 1)
)
xyp1964
发表于 2024-8-19 11:28:27
寒潮大冬瓜 发表于 2024-8-18 00:30
院长好!我用XYP-DXF1964和xyp-MkLaCo函数整了个获取起点10的坐标继续画线的代码,辛苦院长指导
感觉 ...
(defun c:tt ()
(while (setq e (car (entsel"\n选择实体: <退出>")))
(setq a (menucmd "M=$(edtime,$(getvar,date),YYYYMODDhh)"))
(xyp-MkLaCo (strcat (xyp-DXF 8 e) "-FX-" a) 2)
(COMMAND "LINE" (xyp-DXF 10 e) pause "")
)
(princ)
)
寒潮大冬瓜
发表于 2024-8-19 20:26:14
xyp1964 发表于 2024-8-19 11:28
感谢院长!
xyp1964
发表于 2024-8-23 14:00:34
本帖最后由 xyp1964 于 2024-8-23 15:11 编辑
;; xyp-9Pt 实体或选择集9点坐标 (xyp-9Pt ename site)
(defun xyp-9Pt (ename site / MinPT MaxPT p1 p9 p5 p3 p7 p2 p4 p6 p8 i p1a p9a s1 x ob mid)
(defun mid (p1 p2)
(mapcar '(lambda (x) (* x 0.5)) (mapcar '+ p1 p2))
)
(cond ((= (type ename) 'ENAME)
(vla-getboundingbox (vlax-ename->vla-object ename) 'MinPT 'MaxPT)
(setq p1 (vlax-safearray->list MinPT)
p9 (vlax-safearray->list MaxPT)
)
)
((= (type ename) 'VLA-OBJECT)
(vla-getboundingbox ename 'MinPT 'MaxPT)
(setq p1 (vlax-safearray->list MinPT)
p9 (vlax-safearray->list MaxPT)
)
)
((= (type ename) 'PICKSET)
(setq i -1
p1a '()
p9a '()
)
(while(setq s1 (ssname ename (setq i (1+ i))))
(setq ob (vlax-ename->vla-object s1))
(vla-getboundingbox ob 'MinPT 'MaxPT)
(setq p1(vlax-safearray->list MinPT)
p9(vlax-safearray->list MaxPT)
p1a (cons p1 p1a)
p9a (cons p9 p9a)
)
)
(setq p1 (apply 'mapcar (cons 'min p1a))
p9 (apply 'mapcar (cons 'max p9a))
)
)
)
(setq p5 (mid p1 p9)
p3 (if (< (car p9) (car p1))
(list (car p1) (cadr p9) (caddr p1))
(list (car p9) (cadr p1) (caddr p1))
)
p7 (if (< (car p9) (car p1))
(list (car p9) (cadr p1) (caddr p9))
(list (car p1) (cadr p9) (caddr p9))
)
p2 (mid p1 p3)
p4 (mid p1 p7)
p6 (mid p3 p9)
p8 (mid p7 p9)
)
(nth (- site 1) (list p1 p2 p3 p4 p5 p6 p7 p8 p9))
)