TN Posted July 19, 2004 Share Posted July 19, 2004 I have a script that creates an object and numbers it in a record format and on the drawing, it works great. But when I edit the number in the object info pallet the drawing doesn't update unless I move it. I know there is a check box for this and script event. What do I need to add to my script to keep things constantly updated. Please help Quote Link to comment
ClockWerX Posted July 22, 2004 Share Posted July 22, 2004 Hello, I read your question and maybe I can be of some help. Try the following function in your VectorScript code : ReDrawAll; or ReDraw; The first function will redraw all your objects in your document. So possibly this will do the trick. I wish you a very nice day and all the best. Friendly greetings, Chrissy Quote Link to comment
TN Posted July 23, 2004 Author Share Posted July 23, 2004 Chrissy, Thanks for responding. I did finally find the redraw function it works but it is overkill. In the Plug-in editor under properties in the script execution section there is an option called "Reset Only", "Reset on Move". This is what does work except I don't want have to move the object to get a reset to occur. Does any one know how to reset the script instead of redrawing the entire drawing. Thanks Quote Link to comment
ccroft Posted July 24, 2004 Share Posted July 24, 2004 By moving the object you are invoking a redraw......it's the same thing. Redraw,reset,regenerate are all the same.Changing any parameter of a PIO also causes a redraw. Redraws happen all the time. It may be true that using redraw instead of redrawall invokes a redraw of that object only,but I'm not sure. In any event,it's common to use redraw to update (reset) an abject.That is exactly what it's for. Quote Link to comment
ClockWerX Posted July 24, 2004 Share Posted July 24, 2004 Hi, Indeed Ccroft is probably correct. This is what I found in the VectorScript Function reference about the ReDraw command : "Procedure ReDraw invokes a screen redraw of newly created objects in the active VectorWorks document. If new objects are to be manipulated using procedures which operate on selected objects, a call to ReDraw should precede the selected object routines to ensure that all new objects are correctly identified." According the the VS reference Redraw only updates the newly created objects. I can only advise you to try ReDraw and take a close look to what happens. I think this is the best option you have. Have a very nice day. Friendly greetings, Chrissy Quote Link to comment
TN Posted July 29, 2004 Author Share Posted July 29, 2004 Good information! Thanks Jeff I was editing the record in the data pane. If I edit the parameter in the plug-in object "shape" pane it does update on the drawing the way I wanted it to do, perfect. Now I am trying to write a script (plug-in tool) to edit the plug-in object. I now know that editing the parameter does the job, but the new scipt (edit tool) is giving me an error " { Error: Assignment to a constant is not allowed. }". I guess a parameter is a constant? Is it possible to edit (re-initialize) the value of the parameter from a script?? Quote Link to comment
Guest Posted July 30, 2004 Share Posted July 30, 2004 So you have a plug-in object script that places a text node to display the number and it also sets a field of some other record node? When you say you edit the number in the object info, are you editing a parameter of the plug-in object or editing the record using the "Data" pane? I'm not sure I understand your setup, but thought I would mention that there is a ResetObject(h) function in VectorScript also if you think ReDraw is overkill. Jeff Quote Link to comment
Alexandre Villares Posted August 4, 2004 Share Posted August 4, 2004 quote: Originally posted by TN: Is it possible to edit (re-initialize) the value of the parameter from a script?? Yes. SetRField(PIObjectHandle,Getname(PIORecordHandle),ParameterNameString,Concat(NewParValue)); 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.