gsc Posted February 11, 2021 Share Posted February 11, 2021 Hi, I have a lisp routine snippet which modifies the text height of all text objects inside a dynamic block. All text heights in the dynamic block are updated but all dynamic block instances in the drawing are still showing the old text height. I have read somewhere that a "regen" is needed, but that doesn't seem to work. If I "block edit" one of the instances, I see that the text height is changed. However this is only updated for all block instances if I: - "block edit" one of the instances and save (and close) the block - use function "Battman" and sync the original dynamic block name (once dynamic block is changed, the instance block name becomes e.g.) *U211 How do I force to update the dynamic block instances with lisp? (defun ApplytoBlockObjects ( blks name func / def result ) (setq func (eval func)) (if (not (vl-catch-all-error-p (setq def (vl-catch-all-apply 'vla-item (list blks name))))) (vlax-for obj def (setq result (cons (func obj) result))) ) (reverse result) ) ;;; Code snippet in Main Lisp Function (setvar "tilemode" 1) (if (car blk_lst) (progn (if (equal (vla-get-effectivename (vlax-ename->vla-object (car blk_lst))) "Barge-S-TV") (ApplytoBlockObjects (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (vla-get-effectivename (vlax-ename->vla-object (car blk_lst))) '(lambda ( obj ) (if (= (vla-get-objectname obj) "AcDbText") (vla-put-height obj ht_lbl) ) ) ) ) ) ) (command "regen") (setvar "tilemode" 0) Quote Link to comment Share on other sites More sharing options...
danellis Posted February 17, 2021 Share Posted February 17, 2021 Have you tried the REGENALL command? If that doesn't work, could you add: COMMAND "BEDIT" <blockname> COMMAND "BSAVE" COMMAND "BCLOSE" onto the end of your routine? dJE 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.