BIGAL Posted February 18, 2021 Share Posted February 18, 2021 Following on from prior post this is the 1st part, but please note all the ZERO defuns have to be edited to reflect the "ent" as a single object rather than selection set. So using correct entmod to reset Z back to zero. (defun get-block-entities ( blk / ent lst ) (if (setq ent (tblobjname "block" blk)) (while (setq ent (entnext ent)) (setq etyp (cdr (assoc 0 (entget ent)))) (cond ((= etyp "LWPLOYLINE")(pline0)) ((= etyp "LINE")(line0)) ((= etyp "CIRCLE")(Circ0)) ; add more ) ) ) ) (get-block-entities "aaa") Will see if can find time. Quote Link to comment Share on other sites More sharing options...
itssme Posted February 27 Share Posted February 27 (edited) On 2/17/2021 at 8:33 AM, BIGAL said: text0 Thank you for the code. I tried but the z of the text is not good, not equal to 0. Can you edit it again? Thank you very much. Z TEXT 30 NOT 0.dwg Edited February 27 by itssme Quote Link to comment Share on other sites More sharing options...
Craig Black Posted March 14 Share Posted March 14 On 11/15/2013 at 7:57 AM, Lee Mac said: Here is a very simple program to flatten all objects in all blocks & layouts: (defun c:allflat ( / d ) (vlax-for b (vla-get-blocks (setq d (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref b)) (vlax-for o b (if (vlax-write-enabled-p o) (foreach e '(1e99 -1e99) (vlax-invoke o 'move '(0.0 0.0 0.0) (list 0.0 0.0 e)) ) ) ) ) ) (vla-regen d acallviewports) (princ) ) (vl-load-com) (princ) You can very easily run the above program on multiple drawings using a batch processing program, such as my Script Writer program. Hi Lee, I copied and loaded the above code, but it is not working on a file one of my users sent me. The file consists of LOTS of blocks nested within blocks. is there any sort of "nesting limit" within your code (I'm a lisp guy, but not real comfortable with the VL stuff ) Any light you can shed will be appreciated! --Craig Black Quote Link to comment Share on other sites More sharing options...
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.