walton10 Posted June 29, 2010 Posted June 29, 2010 I am trying to create an object on a Layout (tab) which is different from my current Layout. (foreach cLayout myPasteLayoutList (foreach ename myEntNameList (setq elist (entget ename)) (entmake elist) (setq ename (entlast)) (setq ed (entget ename)) (setq ed (subst (cons 410 cLayout) (assoc 410 ed) ed)) (entmod ed) ) ) I have run this with princ's, and also stepped through with traces, and everything is telling me that it is modifying the 410 of my ed with the value stored in cLayout, but the objects continue to appear on the current layout, and not on the proper layout. I would appreciate any insight you can offer. Thanks. Quote
alanjt Posted June 29, 2010 Posted June 29, 2010 This should help... (defun test (pt rad) (mapcar (function (lambda (la) (entmakex (list '(0 . "CIRCLE") (cons 410 la) (cons 10 pt) (cons 40 rad))) ) ) (layoutlist) ) ) Will draw a circle with specified radius in all layouts at specified point and return list of each EName. Quote
walton10 Posted June 29, 2010 Author Posted June 29, 2010 entmakex fixed my problems. Thank you! (foreach cLayout myPasteLayoutList (foreach ename myEntNameList (setq elist (entget ename)) (setq elist (subst (cons 410 cLayout) (assoc 410 elist) elist)) (entmakex elist) ) ) Quote
alanjt Posted June 29, 2010 Posted June 29, 2010 You're welcome. Shortening methods... (foreach cLayout myPasteLayoutList (foreach ename myEntNameList (setq elist (entget ename)) (entmakex (subst (cons 410 cLayout) (assoc 410 elist) elist)) ) ) or (foreach cLayout myPasteLayoutList (foreach ename myEntNameList ((lambda (elist) (entmakex (subst (cons 410 cLayout) (assoc 410 elist) elist))) (entget ename)) ) ) Quote
Recommended Posts
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.