×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

LISP <--> Attributes

LISP <--> Attributes

LISP <--> Attributes

(OP)
Hi,

I'm searching for a lisproutines which copies the value off a selected attribute to a second (and/of more) selected attribute. Can anyone help me for this?

Both of the attributes are visible of course.

regards,
HMO

RE: LISP <--> Attributes

Didn't find one but whipped one together, let me know how it works.

(princ "\nType ATTR to start ")
(defun c:attr ()
  (setq att1 (car (nentsel "\nSelect attribute to copy: ")))
  (redraw att1 3)
  (setq Att1val (cdr (assoc 1 (entget att1))))
  (princ (strcat "\nSelected value is " Att1val))
  (while (setq attpick (car (nentsel "\nSelect attribute to replace: ")))
     (setq attdata (entget attpick))
     (setq attval (assoc 1 attdata))
     (setq InsertName (cdr (assoc 330 attdata)))
     (setq Newdata (subst (cons 1 Att1val) attval attdata))
     (entmod NewData)
     (entupd InsertName)
  );while
  (redraw att1 4)
  (princ)
);defun

RE: LISP <--> Attributes

(OP)
Hi,

the solution you've given me is correct. It works perfect.

Is it now also possible that when you've selected an attribute with value "1" the first replacement attribute is "2" and the second "3".

So when i have a startvalue "5" and i select the replacement attributes value it will be "6" and further on?

regards
HMO

RE: LISP <--> Attributes

It there a way to do this with a block with more than one attribute, like a title block?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources