cadman2009 Posted September 20, 2010 Posted September 20, 2010 Hi and have a good times when I load this codes after select objects this error occurs : _$ ; error: too few arguments please show me my mistake and help me thanks codes: (vl-load-com) (setq x_objex_text (entsel)) ;select first text (setq x_object (vlax-Ename->Vla-Object (car x_objex_text))) (setq y_objex_text (entsel)) ;select second text (setq y_object (vlax-Ename->Vla-Object (car y_objex_text))) (mapcar '(lambda (x_object) (vla-put-textstring x_object (rtos (+ (atof (vla-get-textstring x_object)) (atof (vla-get-textstring y_object)) ) 2 2 ) ) (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex x_object))) ) ) ) (princ) Quote
Lee Mac Posted September 20, 2010 Posted September 20, 2010 RE: Code formatting: http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines Quote
alanjt Posted September 20, 2010 Posted September 20, 2010 You are selecting your text with entsel (single entity selection), but you are trying to process it as a ssget selection set. Very simplified... (defun c:TEst (/ e1 e2) (if (and (setq e1 (car (entsel "\nSelect first text object: "))) (setq e2 (car (entsel "\nSelect next text object: "))) ) (vla-put-textstring (setq e2 (vlax-ename->vla-object e2)) (rtos (+ (atof (vla-get-textstring (vlax-ename->vla-object e1))) (atof (vla-get-textstring e2)) ) 2 2 ) ) ) (princ) ) Quote
cadman2009 Posted September 20, 2010 Author Posted September 20, 2010 I'm sorry and I will follow your hint thanks mr Lee Quote
BlackBox Posted September 20, 2010 Posted September 20, 2010 I won't even bother posting my code, because you beat me to it, Alan. For the record... mine is *nearly* identical. lol Quote
cadman2009 Posted September 20, 2010 Author Posted September 20, 2010 Special Thanks Mr Alanjt If I want execute this codes for many numeric text Simultaneously , can I replace entsel by a vlisp Object selection sets or I must use of ssget ? Quote
alanjt Posted September 20, 2010 Posted September 20, 2010 ssget would be the easiest. This may be of interest (did this a while back): Combinevalues [Add/Divide/Multiply/Subtract object values] Quote
cadman2009 Posted September 20, 2010 Author Posted September 20, 2010 Hi Dear Render Man I don't copy your codes and if it is similar to your codes , I'm sorry because my coach gave us it for convert to VB code . Quote
alanjt Posted September 20, 2010 Posted September 20, 2010 my coach gave us it for convert to VB code .I want in on a game that consists of writing code. Quote
cadman2009 Posted September 20, 2010 Author Posted September 20, 2010 Mr Alanjt No it is a colleg mission for me and is part of a method . I have 13 pages vlisp code and I must convert it to VB Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.