Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

LISP <--> Attributes

Status
Not open for further replies.

Hmo

Electrical
Nov 1, 2003
42
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
 
Replies continue below

Recommended for you

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
 
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
 
It there a way to do this with a block with more than one attribute, like a title block?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor