kalai Posted March 22, 2012 Posted March 22, 2012 (edited) I have changed the color of blockref containing text , mtext ,line etc to paticular color. But the mtext ht is changed. (SETQ SS (SSGET '((0 . "INSERT")))) (SETQ K 0) (WHILE (< K (SSLENGTH SS)) (SETQ BLK (SSNAME SS K)) (setq CBL (tblsearch "BLOCK" (CDR (ASSOC 2 (ENTGET BLK))))) (SETQ CBL2 (CDR (ASSOC -2 CBL))) (WHILE (BOUNDP 'CBL2) (SETQ EE (ENTGET CBL2)) (SETQ NCL (CONS 62 C)) (SETQ ACL (ASSOC 62 EE)) (IF (= ACL nil) (SETQ NEWE (APPEND EE (LIST NCL))) (SETQ NEWE (SUBST NCL ACL EE)) );if (ENTMOD NEWE) (SETQ CBL2 (ENTNEXT CBL2)) );end while (ENTUPD BLK) (SETQ K (1+ K)) );end while What could be reason?? the mtext shows paper text ht 2.5 and model text ht is 250. Edited March 22, 2012 by kalai Quote
kalai Posted March 22, 2012 Author Posted March 22, 2012 thanks for your reply, how to correct it Quote
pBe Posted March 22, 2012 Posted March 22, 2012 (edited) use (vla-put-color itm color) (defun c:test ( / lst ss bn) (vl-load-com) (setq c 3);<--- color (if (setq ss (ssget '((0 . "insert")))) (repeat (setq i (sslength ss)) (cond ((and (not (member (setq bn (vla-get-EffectiveName (vlax-ename->vla-object (ssname ss (setq i (1- i)))))) lst)) (setq lst (cons bn lst)) (vlax-for itm (vla-item (vla-get-blocks (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))) bn) (vla-put-color itm c)) )) ) ) ) [color=blue](if lst (foreach nm lst (command "_attsync" "_name" nm))) [/color] (vla-regen adoc acActiveViewport) (princ) ) Entmod and Annotative textstyle just doesnt work is all Edited March 22, 2012 by pBe Attsync Quote
pBe Posted March 22, 2012 Posted March 22, 2012 Thank you so much, It works well Alrighty then.. But did you understand the code? or would you rather have us modify yours to work with vla-put-color ? Quote
pBe Posted March 22, 2012 Posted March 22, 2012 yes i understood Good for you kalai. Glad i could help. Quote
kalai Posted March 22, 2012 Author Posted March 22, 2012 Hi if the block has attributes ,Attribute text color doesnot change Quote
pBe Posted March 22, 2012 Posted March 22, 2012 Hi if the block has attributes ,Attribute text color doesnot change Attsync [see updated code] 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.