Jump to content
Developer Wiki and Function Reference Links ×

update event


TN

Recommended Posts

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

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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

Link to comment

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

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