Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Nov 1, 2003
Messages
42
Location
BE
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
 
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

Back
Top