谢谢大家帮助我!很棒的学习。虽然我会保留一些问题,但当然!
首先:我的常规仍然失败。。。“要点必须明确”
我不知道,但我觉得这和“osnap”有关。转动它不起作用。就在我发布例程之前,我注意到了这一点(下面的红色部分):
这样的事情会引起那样的麻烦
嗯,Alanjt,谢谢你。
我所做的是创建一个例程来镜像我的块,然后再次镜像它们。如果你仔细想想,你会发现这并不是什么都没发生!!
这是我的例行公事,欢迎批评!我需要一些时间来创造这一点,我知道这是混乱的,而不是它应该是这样。像variablenames,他们呢?是不是太长了?
我使用了很多“老式”lisp(命令“_.mirror”…)。
这是一种避免的方法吗?它慢吗。。。?
正如所说:我已经准备好接受一些严肃的评论。
提前感谢!!
-
- ; double mirror function
- ; 21-10-2010 MarcoW
- ; great help ~ CADTutor ~
- (defun c:test (/ mirrorlinepoint1 mirrorlinepoint2
- selectionset numberblocks counter
- blocklist ent entdata newinspt
- newrot newinspt2 rotdgr)
- (setq mirrorlinepoint1 (getpoint "Mirrorline point 1")
- mirrorlinepoint2 (getpoint mirrorlinepoint1 "Mirrorline point 2")
- )
- (prompt
- " « « You really should select one ore more blocks now...» »"
- )
- (if (setq selectionset (ssget '((0 . "INSERT"))))
- (progn (setq numberblocks (sslength selectionset))
- (setq counter 0)
- (while (< counter numberblocks)
- (setq blocklist (ssname selectionset counter))
- (command
- "_.mirror"
- blocklist
- ""
- mirrorlinepoint1
- mirrorlinepoint2
- "no"
- ""
- )
- (setq ent (entlast))
- (setq entdata (entget ent))
- (setq newinspt (cdr (assoc 10 entdata))
- newrot (cdr (assoc 50 entdata))
- newinspt2 (polar newinspt (+ newrot pi) 50)
- )
- (setq rotdgr (/ (* newrot 180) pi))
- (command "_.mirror"
- (entlast)
- ""
- "_NON"
- newinspt
- "_NON"
- newinspt2
- "Yes"
- ""
- )
- (setq counter (1+ counter))
- )
- )
- (princ "Nothing selected!!")
- )
- (princ)
- )
- (princ)
编辑:我想知道,现在我过滤“插入”。因为其他东西,比如线条等,都不起作用。我需要如何处理它,以便我的例程(测试)为所有选定的块执行它的工作,而所有未选定的块都是“正常镜像的”。 |