PDA

View Full Version : Updating Hatch on screen


jmcshane
2006-12-04, 01:37 PM
Hi,
I am trying to write this routine to scale hatch patterns.
The properties of the hatch change, but I just can't seem to
reflect these changes on screen.

Would anybody have any idea's??
Here's what I have so far.

(defun c:HatchTScale () ;(/ EntitySel EntityName OldHatch )
(vl-load-com)
(while
(setq EntitySel (entsel "nSelect Entity: "))
(setq EntityName (car EntitySel))
(setq OldHatch (vlax-ename->vla-object EntityName))
(vla-get-patternScale OldHatch)
(vla-put-PatternScale OldHatch 0.1)
(vla-update OldHatch)
)
)

[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]

kpblc2000
2006-12-04, 01:59 PM
Try to use (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewpotrt)

ElpanovEvgeniy
2006-12-04, 02:30 PM
(vla-Evaluate OldHatch)

jmcshane
2006-12-04, 03:54 PM
Thank you both for your replies,
I had to use them both in order for it to work.

(defun c:HatchScale () ;(/ EntitySel EntityName OldHatch )
(vl-load-com)
(while
(setq EntitySel (entsel "\nSelect Entity: "))
(setq EntityName (car EntitySel))
(setq OldHatch (vlax-ename->vla-object EntityName))
(vla-get-patternScale OldHatch)
(vla-put-PatternScale OldHatch 0.1)
(vla-update OldHatch)
(vla-Evaluate OldHatch)
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewport)
)

)


cheers

John

[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]