PDA

View Full Version : MOVEIT gone wrong


madcadder
2005-06-08, 09:08 PM
I tried to write this real real quick, and pretty dirty, to save some time...
Didn't work.

This is the exact repetition I'm trying to avoid over the next four days:
Drawing opens, select objects, zoom in to select base point, zoom p, zoom in to select new point, zoom p, move. Save and done. (fun, huh)

If I insert this into the command line it works:
(COMMAND "move" "p" "" |pt3| |pt6|)

but if i run the code i get the following error:
Specify second point: ; error: bad argument type: consp "304.89596964"

(DEFUN c:moveit (/)
(SETQ |cmdecho| (GETVAR "cmdecho"))
;;; (SETVAR "cmdecho" 0)
(SETQ |lunits| (GETVAR "lunits"))
(SETVAR "lunits" 2)
(PRINC "nSelect objects to MOVE: ")
(COMMAND "select" "auto" pause)
(SETQ |pt1| (GETPOINT "Specify first corner: ")
|pt2| (GETCORNER |pt1| "Specify opposite corner: ")
)
(COMMAND "zoom" |pt1| |pt2|)
(SETQ |pt3a| (GETPOINT "nSpecify base point: "))
(SETQ |pt3| (STRCAT (RTOS (CAR |pt3a|) 2 8)
","
(RTOS (CADR |pt3a|) 2 8)
)
)
(COMMAND "zoom" "p")
(SETQ |pt4| (GETPOINT "Specify first corner: ")
|pt5| (GETCORNER |pt4| "Specify opposite corner: ")
)
(COMMAND "zoom" |pt4| |pt5|)
(SETQ
|pt6a| (STRCAT (RTOS (CAR (GETPOINT "nSpecify second point: "))))
)
(SETQ |pt6| (STRCAT (RTOS (CAR |pt6a|) 2 8)
","
(RTOS (CADR |pt6a|) 2 8)
)
)
(COMMAND "zoom" "p")
;;; (SETQ |ent| (SSGET "p"))
;;; (INITGET 1)
;;; (COMMAND "move" |ent| "" |pt3| |pt6|)
(COMMAND "move" "p" "" |pt3| |pt6|)
(SETVAR "lunits" |lunits|)
(SETVAR "cmdecho" |cmdecho|)
(PRINC)
)

What did I miss???

kennet.sjoberg
2005-06-08, 09:44 PM
(SETQ |pt6| (STRCAT (RTOS (CAR |pt6a|) 2 8 )
","
(RTOS (CADR |pt6a|) 2 8 )
)
))[/CODE]

What did I miss???

|pt6a| is already a string

: ) Happy Computing !

kennet

madcadder
2005-06-08, 09:56 PM
FIXED IT!
(shaking head, muttering about overlooking the little things)


Thanks,