amb2301 Posted October 5, 2017 Share Posted October 5, 2017 Hi Friends, I require a lisp file to convert the block to Text in required format(as shown in attached Picture). actually i have lots of blocks in my drawing,all to be converted to the below shown format, previous i am doing manually as in below shown steps 1. block edit 2. removing the cyan line & text below to it inside block editor, 3. changing the font height to 2.0 & style as Arial 4. exiting block editor 5. using ATTSYNC command to reflect the changes made in all blocks, 6. select simillar all blocks & making rotation to 0 degree. Also attached .dwg with this, please help me. Thanks, Amb. Annotation re-arrange.dwg Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 5, 2017 Share Posted October 5, 2017 (edited) (defun c:foo (/ a p s) (if (setq s (ssget '((0 . "insert") (2 . "SITE_ANNO") (66 . 1)))) (foreach b (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (and (setq p (cdr (assoc 10 (entget b)))) (setq a (vl-some '(lambda (x) (if (= "ADRESSE" (vla-get-tagstring x)) (vla-get-textstring x) ) ) (vlax-invoke (vlax-ename->vla-object b) 'getattributes) ) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(8 . "SITE_ANNO") '(62 . 1) '(6 . "ByBlock") '(100 . "AcDbText") (cons 10 p) '(40 . 2.0) (cons 1 a) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Style-Arial") '(71 . 0) '(72 . 1) (cons 11 p) '(100 . "AcDbText") '(73 . 0) ) ) (entdel b) ) ) ) (princ) ) Edited October 9, 2017 by ronjonp Quote Link to comment Share on other sites More sharing options...
amb2301 Posted October 6, 2017 Author Share Posted October 6, 2017 (defun c:foo (/ a p s) (if (setq s (ssget '((0 . "insert") (2 . "SITE_ANNO") (66 . 1)))) (foreach b (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (progn (setq p (cdr (assoc 10 (entget b)))) (setq a (vl-some '(lambda (x) (if (= "ADRESSE" (vla-get-tagstring x)) (vla-get-textstring x) ) ) (vlax-invoke (vlax-ename->vla-object b) 'getattributes) ) ) (if (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(8 . "SITE_ANNO") '(62 . 1) '(6 . "ByBlock") '(100 . "AcDbText") (cons 10 p) '(40 . 2.0) (cons 1 a) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Style-Arial") '(71 . 0) '(72 . 1) (cons 11 (cdr (assoc 10 (entget b)))) '(100 . "AcDbText") '(73 . 0) ) ) (entdel b) ) ) ) ) (princ) ) Hi Ronjonp, excellent work, it made our work so simple, thank you so much for your help:) i am fully satisfied with your lisp work Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 6, 2017 Share Posted October 6, 2017 Hi Ronjonp, excellent work, it made our work so simple, thank you so much for your help:) i am fully satisfied with your lisp work Glad to help Quote Link to comment Share on other sites More sharing options...
amb2301 Posted October 7, 2017 Author Share Posted October 7, 2017 Hi Ronjonb, one more help on that same lisp, i tried changing the font style to "Arial Black" instead of "Arial", but its not working, could you please check & help me on that ? Thanks, Amb Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 9, 2017 Share Posted October 9, 2017 (edited) Maybe this? (defun c:foo (/ a p s) (entmakex '((0 . "STYLE") (100 . "AcDbSymbolTableRecord") (100 . "AcDbTextStyleTableRecord") (2 . "ArialBlack") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "ariblk.ttf") (4 . "") ) ) (if (setq s (ssget '((0 . "insert") (2 . "SITE_ANNO") (66 . 1)))) (foreach b (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (and (setq p (cdr (assoc 10 (entget b)))) (setq a (vl-some '(lambda (x) (if (= "ADRESSE" (vla-get-tagstring x)) (vla-get-textstring x) ) ) (vlax-invoke (vlax-ename->vla-object b) 'getattributes) ) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(8 . "SITE_ANNO") '(62 . 1) '(6 . "ByBlock") '(100 . "AcDbText") (cons 10 p) '(40 . 2.0) (cons 1 a) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "ArialBlack") '(71 . 0) '(72 . 1) (cons 11 p) '(100 . "AcDbText") '(73 . 0) ) ) (entdel b) ) ) ) (princ) ) Edited October 9, 2017 by ronjonp Quote Link to comment Share on other sites More sharing options...
amb2301 Posted October 9, 2017 Author Share Posted October 9, 2017 Maybe this? (defun c:foo (/ a p s) (entmakex '((0 . "STYLE") (100 . "AcDbSymbolTableRecord") (100 . "AcDbTextStyleTableRecord") (2 . "ArialBlack") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "ariblk.ttf") (4 . "") ) ) (if (setq s (ssget '((0 . "insert") (2 . "SITE_ANNO") (66 . 1)))) (foreach b (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (and (setq p (cdr (assoc 10 (entget b)))) (setq a (vl-some '(lambda (x) (if (= "ADRESSE" (vla-get-tagstring x)) (vla-get-textstring x) ) ) (vlax-invoke (vlax-ename->vla-object b) 'getattributes) ) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(8 . "SITE_ANNO") '(62 . 1) '(6 . "ByBlock") '(100 . "AcDbText") (cons 10 p) '(40 . 2.0) (cons 1 a) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "ArialBlack") '(71 . 0) '(72 . 1) (cons 11 (cdr (assoc 10 (entget b)))) '(100 . "AcDbText") '(73 . 0) ) ) (entdel b) ) ) ) (princ) ) Hi Ronjonp, this is exactly which i want, you work is perfect. Thank you so much for your help!!! Regards, Amb Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 9, 2017 Share Posted October 9, 2017 Glad to help Quote Link to comment Share on other sites More sharing options...
amb2301 Posted October 9, 2017 Author Share Posted October 9, 2017 Glad to help Hi Ronjonp, similar kind of another block i tried with modifying your given lisp, but its not happening,can i post it as a new post? 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.