Jump to content

Recommended Posts

Posted (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 by kalai
Posted

thanks for your reply,

 

how to correct it

Posted (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 by pBe
Attsync
Posted
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 ?

Posted
yes i understood

 

Good for you kalai.

 

Glad i could help. :)

Posted

Hi if the block has attributes ,Attribute text color doesnot change

Posted
Hi if the block has attributes ,Attribute text color doesnot change

 

Attsync

 

[see updated code]

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