Jump to content

What's wrong with this?


Recommended Posts

Posted

The following is just my very first attempt at a lisp to change 5 attribute values in a block. So far I just want to see if I can even find the attribues via DXF codes.

(defun C:Test1
 (setq Ename (entlast))
 (setq Att1 (entnext Ename))
 (setq Att2 (entnext Att1))
 (setq Att3 (entnext Att2))
 (setq Att4 (entnext Att3))
 (setq Att5 (entnext Att4))
 (princ Att1)
 (princ Att2)
 (princ Att3)
 (princ Att4)
 (princ Att5)
 )

 

This is the error I get

_$

; error: bad element in arguments list: (ENTLAST)

_$

 

however if I paste one line at a time it seems to work. what am I missing? probably something very simple.

Posted

I Fee Like An Idiot! :oops:

Posted

From the look of the code, It looks like your trying to explore and see values. Are you aware that in vlide, You can 'Watch" items and look at the value of Varriables?

 

Flower

Posted

This may be more use for your learning:

 

(defun C:Test1 (/ Ename Att1 Att2 Att3 Att4 Att5)
 (setq Ename (entlast))
 (setq Att1 (entnext Ename))
 (setq Att2 (entnext Att1))
 (setq Att3 (entnext Att2))
 (setq Att4 (entnext Att3))
 (setq Att5 (entnext Att4))
 (princ (entget Att1))
 (princ (entget Att2))
 (princ (entget Att3))
 (princ (entget Att4))
 (princ (entget Att5))
 (princ)
 )

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