Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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

Posted

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

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