2008年2月19日 星期二

[轉貼 Jeff_M] 面域物件轉聚合線物件

 

[轉貼 Jeff_M] 面域物件轉聚合線物件
http://www.theswamp.org/index.php?topic=17443.0

(defun c:Reg2Poly (/ ss)
  (if (setq ss (ssget '((0 . "REGION"))))
    (progn
      (setvar "qaflags" 1)
      (command ".explode" ss "")
      (setvar "qaflags" 0)
      (if (= 1 (getvar "peditaccept"))
 (command ".pedit" "m" "p" "" "j" "" "")
 (command ".pedit" "m" "p" "" "y" "j" "" "")
 )
      )
    )
  (princ)
  )

 

http://www.tstmr.com/tmr/dispbbs.asp?boardID=6&ID=1928&page=1

QAFLAGS是個未公佈的系統變量

通常用來在LISP中控制選擇集中多個對象炸開的

QAFLAGS還對ctrl起作用,如果QAFLAGS=1,那麼進行Ctrl+c的時候就不能先選物體再複製。如果QAFLAGS=0,就可以先選物體再複製。


* What is QAFLAGS?

QAFLAGS been used a long time (< r12) by deelopers and autodesk themself too.

QAFLAGS acceps a alue between 0 and 32767
bit 0 (1) : ^C in menu macro cancels grips (acts like keyboard ).
bit 1 (2) : no pause during text screen listings.
bit 2 (4) : no "alert" dialogs (text display instead).
bit 7 (128) : accepts "screen picks" (point lists) ia (command) function.

Normally QAFLAGS should be set to 0. Because it might be set to other alues it is a good idea to put (setar "QAFLAGS" 0) in acaddoc.lsp or any other of your lisp files that you use for startup