Olhado_ Posted October 12, 2009 Posted October 12, 2009 (defun C:cb () (setq blkent (car (entsel "Select block to Copy: ")) lstent (entget blkent)) (setq ptcpy (getpoint "Enter Point to copy: ")) (setq ptcpy (cons '10 ptcpy)) (setq lstnewent lstent) (setq lstnewent (subst ptcpy (assoc 10 lstent) lstnewent)) (entmake (list (assoc 0 lstnewent) (assoc 8 lstnewent) (assoc 2 lstnewent) (assoc 10 lstnewent) (assoc 41 lstnewent) (assoc 42 lstnewent) (assoc 43 lstnewent) (assoc 50 lstnewent) )) ) I am trying to copy a block and still be able to edit the attribute (attached is a block). I can currently copy a block; but then when I try running the eattedit command I get the following: "That block has no editable attributes." I think it may have something to do with the entity group code 330; but I cannot be certain. I know there is the copy function; but I am trying to do other things to this block once it is copied. Does anyone have any advice? FLAG.dwg Quote
nukecad Posted October 12, 2009 Posted October 12, 2009 Have you tried exploding after you have inserted? You may have a block-within-a-block situation. Quote
alanjt Posted October 12, 2009 Posted October 12, 2009 I know it's VLA, but does this help? (defun c:CB (/ #Block #Point) (vl-load-com) (and (setq #Block (car (entsel "\nSelect block to copy: "))) (eq "INSERT" (cdr (assoc 0 (entget #Block)))) (setq #Point (getpoint "\nSpecify placement point: ")) (setq #Block (vla-copy (vlax-ename->vla-object #Block))) (vla-move #Block (vla-get-insertionpoint #Block) (vlax-3d-point (trans #Point 0 1)) ) ;_ vla-move ) ;_ and (princ) ) ;_ defun Quote
David Bethel Posted October 13, 2009 Posted October 13, 2009 Make sure you add the sequential flag (66 . 1) to the INSERT data to have access to the ATTRIButes. Then you must add the ATTRIB entity definitions. Then you must add a ENDBLK entity. Not the cleanest way to make an INSERT but it is what it takes via entmake. -David Quote
Olhado_ Posted October 13, 2009 Author Posted October 13, 2009 Thanks for the help, everyone. After all the comments I think I might go with the VLA code since it seems to be the simpliest. Although, I have to say out of all the code used in AutoCAD, VLA is currently the one my mind has the hardest time thinking of. It also sounds like the entmake command might really just be useful for the basic entities in LISP (i.e. line, polylines, circle, arcs) Thanks again. 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.