Jump to content
Developer Wiki and Function Reference Links ×

Does 'ReDrawAll' not work properly?


Recommended Posts

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);

Link to comment

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.

Link to comment

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

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