Jump to content
gsc

Modified Dynamic Block entity does not update Block Instances

Recommended Posts

gsc

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)

 

Share this post


Link to post
Share on other sites
danellis

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

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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