dclsendstring too many arguments

Started by andrew, December 06, 2010, 07:40:42 AM

Previous topic - Next topic

andrew

having an issue with a project im working on.

the following code works however when trying to send a acad command thru i get a "too many arguments" error

can someone point out what im doing wrong?



(defun zoomtext (/)
(command "_.zoom" "_w" xy1 xy2)
)

(defun c:oSTKBK_Form1_find_OnClicked (/)


(SETQ SS1 (SSGET "X" (LIST (CONS 0 "TEXT"))))
(SETQ SSL (SSLENGTH SS1))
(SETQ CNT1 0)
(setq kk "Next")
(SETQ OLDS (strcase (dcl_Control_GetText oSTKBK_Form1_TextBox1)))
(WHILE (and (SETQ EN (SSNAME SS1 CNT1)) (eq kk "Next"))
(SETQ ED (ENTGET EN))
(SETQ ET (CDR (ASSOC 1 ED)))
(IF (WCMATCH ET (STRCAT "*" OLDS "*")) (PROGN
(setq x1x (car (cdr (assoc 10 ed))))
(setq y1y (cadr (cdr (assoc 10 ed))))
(setq sclxy (CDR (assoc 40 ed)))
(setq x2x (rtos (- x1x (* sclxy 30))))
(setq x3x (rtos (+ x1x (* sclxy 30))))
(setq y2y (rtos (+ y1y (* sclxy 20))))
(setq y3y (rtos (- y1y (* sclxy 20))))
(setq xy1 (strcat x2x "," y3y))
(setq xy2 (strcat x3x "," y2y))
(dcl_sendstring "_.zoom" "_w" xy1 xy2)  <--- this is the issue
(dcl_sendstring "zoomtext ")  <-- this doesnt work either
(setq xyx 1)
(setq lyr1 (cdr (assoc 8 ed)))
(setq lyr2 "0")
(while (<= xyx 5)
(setq ed (subst (cons 8 lyr2) (assoc 8 ed) ed))
(entmod ed)
(setq ed (subst (cons 8 lyr1) (assoc 8 ed) ed))
(entmod ed)
(setq xyx (+ xyx 1))
);end while
(defun c:oSTKBK_Form1_next_OnClicked (/)
(setq kk "Next")
)
)
)
(SETQ CNT1 (1+ CNT1))
)

) ; end find onclick
[\code]

any help is appreciated

owenwengerd

The separate zoomtext function is how I would handle this. How does it fail?
Owen Wengerd (Outside The Box) / ManuSoft

andrew

I got it to work by doing the following

(dcl_sendstring "(zoomtext) ")

the other way, it just wouldnt call the function
and the way with the command in it, gave me too many arguments.

got it working though
thanks

owenwengerd

Ah yes, you would need to define it as (defun c:zoomext ...) if you want to run it like a command.
Owen Wengerd (Outside The Box) / ManuSoft

andrew

oh  :o
duh on my part, that explains everything now lol

thanks Owen