Greetings everyone.
I have stumbled upon a nut that I can't crack no matter what I try and where I look.
A part of a LISP that I'm working on creates a hatch for a given region (created form a polyline) then puts this region through a series of boolean operations (subtraction and intersection) and then deletes the region because it is no longer necessary.
Here is that part of the code
(setq hatch
(vla-addhatch mspace acHatchPatternTypePreDefined
"SOLID" :vlax-true )) ;create hatch object (vla-setRGB col 100 50 12)
(vla-put-trueColor hatch col)
(vlax-invoke hatch 'appendouterloop reg1
) ;append reg1 as a hatch boundary
(vla-boolean (car reg1
) acIntersection
(car reg2
)) ;create intersection between two regions
) ;end fun
The code works perfectly fine if I don't delete the region or if I delete it (manually or vith vl-delete) after the routine is finished.
I tied to put these commands one by one in the VL editor and see what's going on on the screen.
Apparently the hatch only gets boolean update after I exit the editor and return to my active document.
I have tried all the update techniques I know: I tried updating both the hatch and the region with vla-update and entmod, regenerating active document with vla-regen, redrawing with redraw. Nothing seems to work.
It seems that there is some other kind of "refresh" going on after you switch from VL editor window to AutoCAD window.
Any ideas will be highly appreciated!
Thank you in advance.