Frank Schnater Posted July 24, 2023 Share Posted July 24, 2023 Hello all, See script below: I wanted to use an old script; changed it a bit and found that 'redrawall' still does not work (ever since 1999!). Is that correct or is there something wrong with my script? The script switches 'Show Dim Value' on again; this works, but I have to force the lines to redraw 'manually'. (by cut/paste or save/re-open the file etc) Regards, Frank Schnater {© Frank Schnater, 13-05-1999, 24-07-2023} procedure maataanpasser; {deze procedure maakt bij maatlijnen van 70 de tekst zichtbaar} procedure wijzig_maatlijn(maatlijn:handle); VAR maat_tekst: STRING; begin maat_tekst:= GetDimText(maatlijn); if maat_tekst='70' then begin SetObjectVariableBoolean(maatlijn,6,TRUE); end; end; {main routine, laat procedure wijzig_maatlijn op alle maatlijnen los} begin ForEachObject(wijzig_maatlijn,(T=dimension)and(Sel=true)); ReDrawAll; end; RUN(maataanpasser); Quote Link to comment
Pat Stanford Posted July 24, 2023 Share Posted July 24, 2023 RedrawAll works just fine. Dimensions are "basically" Plug-in Objects (actually they are primitives, but the settings in the OIP work the same way as the parameters of a PIO). The SetObjectVariable procedure is changing a parameter of the dimension, but since the dimension is already in the drawing its "script" does not run and realize that it is supposed to change. So when RedrawAll is called it redraws what is already there. Add a ResetObject(maatlijn); after the SetObjectVariable line and it will work as you want. ResetObject basically forces the Dimension "script" to run. To look at the current parameters and set it self to draw as the parameters are set. HTH. Quote Link to comment
Frank Schnater Posted July 25, 2023 Author Share Posted July 25, 2023 Hello Pat, Thank you for your reply: that works perfectly! (I had inserted: BEGIN {forceer ReDraw} OudeKlas:= GetClass(maatlijn); SetClass( maatlijn, OudeKlas ); END; but your solution is how it should be.) Frank Quote Link to comment
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.