谢谢李-对不起,如果我不清楚。我写的代码只是一个例子——它恰好是我使用的“rotate”。我的原始代码太大,无法发布,所以我只是做了一些我认为可以解释我的问题的东西,因此延迟和随机比较数字-我只是认为它可以显示发生了什么。
我的问题是如何在修改后恢复原始对象。
编辑
没关系,我想出了一个办法。
首先,列出所有顶点的点列表。
然后在最后使用以下工具重新绘制:
(命令“_PLINE”)(mapcar命令PntLst)(命令“c”)
所以我现在有:
- (defun c:Original (/ enaPline LowLeft e1 e2 ObjName PntLst)
- (vl-load-com)
- (setq enaPline (car (entsel "\nSelect closed pline rectangle : ")))
- ;make a list of all vertices
- (setq eprPline(entget enapline))
- (foreach lstTemp eprPline
- (if (= (car lstTemp) 10)
- (setq PntLst (append PntLst (list (cdr lstTemp))))
- );if
- );foreach
-
- (setq ObjName (vlax-ename->vla-object enaPline))
- (vla-GetBoundingBox ObjName 'LowLeft 'UpRight)
- (setq LowLeft (vlax-safearray->list LowLeft))
- (command "ROTATE" enaPline "" LowLeft 35 )
- (setq e2 (entlast))
- (command "delay" 3000);slow down to see whats happening
-
- (if (not(equal 1000 1200 ));test example numbers
- (progn
- (entdel e2);delete modified object
- (command "_PLINE") (mapcar 'command PntLst) (command "c");reinstate object
- )
- )
- );defun
|