michaelk Posted July 9, 2013 Share Posted July 9, 2013 I'm trying to write a very very simple script that is eluding me. I'd like a script that closes the db headers of all worksheets in a drawing. I thought it would be super simple. Something like: Procedure CloseAllHeaders; Procedure CloseThatHeader (CurrentWorkSheet :HANDLE); Begin SetObjectVariableBoolean(CurrentWorkSheet,82,FALSE); END; Begin ForEachObject(CloseThatHeader, (((T=WORKSHEET)))); End; RUN(CloseAllHeaders); I have tried: Declaring the variable in the main procedure Opening the worksheet - EditObjectSpecial(CurrentWorkSheet,0); Almost every procedure/function that looks promising in the worksheet section.... T=56 T=SPREADSHEET I'm assuming that since the script will open all the worksheets that I'm really getting the handles to each. But why won't it edit? I find it puzzling that, with an open worksheet, this works perfectly: Procedure ToggleDBHeader; VAR WSHand : Handle; BEGIN WSHand:=GetTopVisibleWS; SetObjectVariableBoolean(WSHand,82,NOT GetObjectVariableBoolean(WSHand,82)); END; RUN(ToggleDBHeader); Once again I come here to ask: "What am I doing wrong?" Thanks! MK Quote Link to comment
MullinRJ Posted July 9, 2013 Share Posted July 9, 2013 I'm trying to write a very very simple script that is eluding me.Maybe it's not that simple? Glib remarks aside, I believe you are working with the shadow and not the object causing the shadow. T=56 is the image of a Worksheet placed in the drawing. It is like a symbol instance compared to a Symbol Definition. T=18 is the actual Worksheet. I haven't vetted any of your subsequent thinking, so this isn't a complete answer, but I'd try working with the actual Worksheet "definition". HTH, Raymond Quote Link to comment
Hippocode Posted July 9, 2013 Share Posted July 9, 2013 maybe if you get all the names of the worksheets here from the resourcelist : http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=155090 And use it a loop GetOjbect(WsName); to get the right handle. That might work. 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.