Jump to content

Recommended Posts

Posted

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)

Posted

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)
)

Posted

I'm sorry and I will follow your hint

thanks mr Lee

Posted

I won't even bother posting my code, because you beat me to it, Alan.

 

For the record... mine is *nearly* identical. lol

Posted

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 ?

Posted

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 .

Posted
my coach gave us it for convert to VB code .
I want in on a game that consists of writing code.
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...