我试图编写一个lisp例程来自动选择天花板网格中点的中心。因此,当您在天花板网格的“框”中为该点选择一个点时,无论网格是否旋转,它都会在该网格点的死点插入一个块。
那么,在一个长方体中选取一个点,并返回该长方体的死点,无论旋转如何?
像泥一样清澈?我有一个这样做的网格是在0度运行。。。。。没有优化的代码,所以不要锤我。它适用于我们:-)
- (defun c:MULT8 ()
- (setq aper (getvar "aperture"))
- (setvar "aperture" 50)
- (command "setvar" "cmdecho" "0")
- (if (= VALUE nil) (setq VALUE " "))
- ; (setq q1 (strcat "\nWhat is attribute value? <" VALUE ">.."))
- ; (setq OL VALUE VALUE (strcase (getstring q1)))
- (if (= VALUE "") (setq VALUE OL))
- (SETQ PT NIL)
- (SETQ PT (GETPOINT))
- (while (NOT (NULL PT))
- (setq newpt (osnap pt "int"))
- (if (/= newpt nil)
- (progn
- (setq angfound (rtd (angle newpt pt)))
- (cond
- (
- (and
- (> angfound 0)
- (< angfound 90)
- )
- (setq angins 45)
- )
- (
- (and
- (> angfound 90)
- (< angfound 180)
- )
- (setq angins 135)
- )
- (
- (and
- (> angfound 180)
- (< angfound 270)
- )
- (setq angins 225)
- )
- (
- (and
- (> angfound 270)
- (< angfound 360)
- )
- (setq angins 315)
- )
- (
- (= angfound 180)
- (setq angins 0)
- )
- (
- (= angfound 90)
- (setq angins 270)
- )
- (
- (= angfound 0)
- (setq angins 180)
- )
- (
- (= angfound 270)
- (setq angins 90)
- )
- )
- )
- )
- (if (= newpt nil)
- (progn
- (setq newpt pt)
- (print "newpt")
- (command "insert" block newpt "" "" "")
- )
- (progn
- (print"past")
-
- (setq inpt (polar newpt (dtr angins) (sqrt 288)))
- (command "insert" block inpt "" "" "")
- )
- )
-
-
- (COMMAND "SETVAR" "HIGHLIGHT" "1")
- (SETQ PT NIL)
- (SETQ PT (GETPOINT))
- )
- )
|