TiTaNiuM sAMuRai Posted August 16, 2002 Share Posted August 16, 2002 Didja know that PIO code is not run at load-up? Objects are not re-executed at that time; they are just drawn as the elements which comprise the object. Quote Link to comment
Matthew Giampapa Posted August 16, 2002 Share Posted August 16, 2002 Yes, this makes it impossible to run a script automatically when you open a file. Generally speaking the best solution I know is to have a menu command that "touches" the PIO and causes it to regenerate. Hopefully we will have a better solution for this type of problem in a future version of VectorWorks. Matthew GiampapaNNA Technical Support Quote Link to comment
joe newell's ghost Posted August 16, 2002 Share Posted August 16, 2002 Is this the reason I can't edit the attributes of PIO's that have been inserted into a drawing in a previous session? Quote Link to comment
arthur&l?on Posted August 16, 2002 Share Posted August 16, 2002 I]Hopefully we will have a better solution for this type of problem in a future version of VectorWorks.[/i] I also noticed that making a pio regenerate another one is not possible. I wrote a set of 2d level pio : the first one is a tool that places a reference pio named 'zero' and then calls level plugin objects referring to this zero to retrieve their own y coordinates. The dark side is that when 'zero' is moved, plug-in objects don't regenerate themselves unless a regenerating menu is run. Maybe for VS 10 ? Regards Francesco Quote Link to comment
Fuge Posted August 16, 2002 Share Posted August 16, 2002 Francesco, You can make a PIO regenerate on a move bychecking the Reset on Move of the PIO under the Object Properties under Create Plug-In... If I understand to correctly you can do want you wanted. Dave Quote Link to comment
arthur&l?on Posted August 17, 2002 Share Posted August 17, 2002 Ouch..please excuse my bad english and thank you. But no, I don't think cos the deal is this one : one pio is taken as a reference (x,y) by others to evaluate their own coordinates. If you move them all you're right. But if you move only the reference, others don't move so there's to call a regeneration of all pios. This can be done with a menu or tool plugin but it doesn't work, even with the same code, something as setclass(getclass) as far as I recall, from within another pio. Regards Francesco Quote Link to comment
Alexandre Villares Posted August 17, 2002 Share Posted August 17, 2002 Here goes some code to redraw all PIOs in a drawing: Procedure ReveilleMatin;{'r?veille-matin' is French for 'alarm clock' }{it will 'wake up' (redraw) all Plug-In Objects (PIOs) }{This will only work from inside a resource script, }{command menu (VSM) or tool (VST) } {-----------------------------------} Procedure WakeUp( H : Handle); BEGIN SetClass(H,getclass(H)); END; {-----------------------------------} BEGIN ForEachObject(WakeUp,((T=PlugInObject))); END; Run(ReveilleMatin); [ 08-17-2002: Message edited by: Alexandre B A Villares ] Quote Link to comment
arthur&l?on Posted August 17, 2002 Share Posted August 17, 2002 Exactly, Alexandre.Anyway, this will only work if belonging to a vsm or vst, not vso. Francesco Quote Link to comment
TiTaNiuM sAMuRai Posted August 19, 2002 Author Share Posted August 19, 2002 Joe: yes. You get the object as drawn last, but if you don't have the _same_ plug-in (and same version), or the plug-in at all, you can't edit it. Quote Link to comment
Alexandre Villares Posted August 20, 2002 Share Posted August 20, 2002 Francesco, Crazy idea... How about a path plug-in? Forget the path itself and make each node/vertex be an instance of your reference marker. The reshape tool will let you change the origin and have all markers recalculated/redrawn on the spot. [ 08-21-2002: Message edited by: Alexandre B A Villares ] Quote Link to comment
TiTaNiuM sAMuRai Posted August 20, 2002 Author Share Posted August 20, 2002 Alexandre: How is your script different from clicking on Create Plug-in, then clicking Done? I believe that also regenerates all PIO's. Quote Link to comment
Fuge Posted August 21, 2002 Share Posted August 21, 2002 Francesco, I've done some experiments and found that you can regenerate one PIO from another. If the PIO that you want to regenerate is selected first it can be done. Now that may not be perfect but it does work. If your willing to regenerate your parent PIO twice in a row the first regeneration can select the child PIO and the second regeneration can then do the parameter changes to the child even from within the parent. You also mentioned being able to regenerate a PIO from a menu command. Why not try calling your menu command from within your PIO. May not work depending on the order of scripts being executed. If nothing else some ideas to try.Dave [ 08-20-2002: Message edited by: Fuge ] Quote Link to comment
Alexandre Villares Posted August 22, 2002 Share Posted August 22, 2002 quote: TiTaNiuM sAMuRai: How is your script different from clicking on Create Plug-in, then clicking Done? I believe that also regenerates all PIO's. It's no different. But It sounds much better to tell my clients they should call the 'redraw plug-ins' menu command I made for them [ 08-21-2002: Message edited by: Alexandre B A Villares ] Quote Link to comment
arthur&l?on Posted September 18, 2002 Share Posted September 18, 2002 Ouch...Sorry to be so late.Thanks for suggestions.If someone wants to go on with these basic scripts for automatic levels, they are here : http://homeusers.brutele.be/fbellazecca/Niv.zip The tool places once one reference pio and after level symbols with y coordinates from the ref.Works well at 1:50 scale. Regards. 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.