David L Posted January 15, 2009 Share Posted January 15, 2009 I have the following script that consecutively numbers doors as you click on them, but the numbering only shows after you complete the script. I would like it to update (redraw) the drawing as you click on each door (so you can see the new door number) during the script execution. I've tried everything I can think of (ResetObject, ReDraw, ReDrawAll, etc.) but nothing seems to update during script execution. Any recommendations are appreciated. ================================================================= PROCEDURE NumberDoorsConsecutive; VAR ???numberStr : STRING; ???h,h2 : HANDLE; ???pX,pY : REAL; ???doorNumber,dummyVar : INTEGER; PROCEDURE SetDoorNumber; BEGIN GetPt(pX,pY); ??IF GetRField(h2,'Door','IDLabel') <> '' THEN BEGIN ????SetRField(h2,'Door','IDLabel',numberStr); ????ResetObject(h2); ????doorNumber := Str2Num(numberStr); {convert number string to number} ????numberStr := Num2Str(0, doorNumber + 1); {increment number then convert to number string} ??END; END; BEGIN numberStr := StrDialog('Enter and INTEGER to start numbering:','101'); Message('Click in empty space to end Door numbering'); ??WHILE GetPickObjectInfo(pX,pY,h,h2,dummyVar) DO BEGIN ????SetDoorNumber; ??END; ClrMessage; END; RUN(NumberDoorsConsecutive); Plug-In command is also attached: Quote Link to comment
Vectorworks, Inc Employee klinzey Posted January 15, 2009 Vectorworks, Inc Employee Share Posted January 15, 2009 There can only be one vectorscript running at a time so the doors will not regenerate and update till your script is finished. Quote Link to comment
Miguel Barrera Posted January 16, 2009 Share Posted January 16, 2009 David, Try implementing the code as a tool plugin instead of a menu. This way it will execute the script and renumber every time you click on an object. The tool will be active until you select another tool. 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.