Mark Aceto Posted August 3, 2020 Share Posted August 3, 2020 10 hours ago, Boh said: How bizzare also that you managed to figure that out!!!! Note to self: add 2 blank columns to the right of all worksheets from now on... 1 Quote Link to comment
Pat Stanford Posted August 3, 2020 Share Posted August 3, 2020 11 hours ago, Boh said: How bizzare also that you managed to figure that out!!!! Pure luck. I added a column so I could try another version of the formula and boom the first Runscript worked. ;-) 1 Quote Link to comment
Neda Roohnia Posted April 13, 2022 Share Posted April 13, 2022 On 8/2/2020 at 10:04 PM, Boh said: How bizzare! Yes I added a couple of columns and now it works. I then deleted both the columns and it still works. Bugsville! How bizzare also that you managed to figure that out!!!! On 1/9/2018 at 9:55 AM, Pat Stanford said: OK, here you go. There are two scripts attached. One that returns the scale as a real number, the other that returns it as a string showing as "1:Scale". If you save these scripts into your file (any script palette will do), then you can call them in a worksheet by using a function of "=RunScript('ScriptName')". Where the script name is replaced by the name you are showing in the script palette. Copy everything in the code blocks below. You can name the scripts anything you want, but I named them "Get_VP_Scale" and "Get_VP_Scale_Text". If you want to be able to use these across multiple files without having to have the script in each file, create a new VW file that contains the script(s) and save it in the Defaults folder for Reports and Schedules. /Users/Your User Name/Library/Application Support/VectorWorks/2017/Libraries/Defaults/Reports_Schedules. Then modify the function in the worksheet to "=RunScript(120,'ScriptName') If you need a different format, the scripts can be embellished as necessary to do other processing of the numbers/text to get the output you want. Procedure Get_VP_Scale; Var H1:Handle; R1:Real; Begin H1:=WSScript_GetObject; R1:=GetObjectVariableReal(H1,1003); WSScript_SetResReal(R1); End; Run(Get_VP_Scale); Procedure Get_VP_Scale_Text; Var H1,H2:Handle; N1:Integer; R1:Real; S1:String; Begin H1:=WSScript_GetObject; R1:=GetObjectVariableReal(H1,1003); WSScript_SetResStr(Concat('1:',R1)); End; Run(Get_VP_Scale_Text); On 8/2/2020 at 9:26 PM, Pat Stanford said: The scripts were written in 2018, so they should work in 2019. Don't know what else to tell you. I just downloaded VW2019. You are correct. It is broken in 2019SP6. 😞 BUT, there seems to be a strange work around. If you add two blank columns to the right of the column(s) with the Runscript commands, then they calculate correctly. VERY strange. Hi On 1/9/2018 at 9:55 AM, Pat Stanford said: OK, here you go. There are two scripts attached. One that returns the scale as a real number, the other that returns it as a string showing as "1:Scale". If you save these scripts into your file (any script palette will do), then you can call them in a worksheet by using a function of "=RunScript('ScriptName')". Where the script name is replaced by the name you are showing in the script palette. Copy everything in the code blocks below. You can name the scripts anything you want, but I named them "Get_VP_Scale" and "Get_VP_Scale_Text". If you want to be able to use these across multiple files without having to have the script in each file, create a new VW file that contains the script(s) and save it in the Defaults folder for Reports and Schedules. /Users/Your User Name/Library/Application Support/VectorWorks/2017/Libraries/Defaults/Reports_Schedules. Then modify the function in the worksheet to "=RunScript(120,'ScriptName') If you need a different format, the scripts can be embellished as necessary to do other processing of the numbers/text to get the output you want. Procedure Get_VP_Scale; Var H1:Handle; R1:Real; Begin H1:=WSScript_GetObject; R1:=GetObjectVariableReal(H1,1003); WSScript_SetResReal(R1); End; Run(Get_VP_Scale); Procedure Get_VP_Scale_Text; Var H1,H2:Handle; N1:Integer; R1:Real; S1:String; Begin H1:=WSScript_GetObject; R1:=GetObjectVariableReal(H1,1003); WSScript_SetResStr(Concat('1:',R1)); End; Run(Get_VP_Scale_Text); Hi Pat, this works perfectly! How can I use this directly for my titleblock to update the sheet scales automatically? Quote Link to comment
Pat Stanford Posted April 13, 2022 Share Posted April 13, 2022 If you are using the Title Block Border object I don't think you can use this at all. You might be able to use a worksheet script to store the value into a Record.Field attached to your title block and then possibly use that as a text field. I don't think I fully understand what you want to be able to do. 1 Quote Link to comment
Mark Aceto Posted April 14, 2022 Share Posted April 14, 2022 23 hours ago, Neda Roohnia said: Hi Pat, this works perfectly! How can I use this directly for my titleblock to update the sheet scales automatically? It's a logic problem. I have a friend that has been asking for this for years, and my response has always been the same, "How would VW manage that with more than 1 viewport on the same sheet layer but not all of the viewports are the same scale?" 1 Quote Link to comment
Neda Roohnia Posted April 14, 2022 Share Posted April 14, 2022 17 hours ago, Mark Aceto said: It's a logic problem. I have a friend that has been asking for this for years, and my response has always been the same, "How would VW manage that with more than 1 viewport on the same sheet layer but not all of the viewports are the same scale?" That's a very good point! They can set it up in a way that if there is more than one VP on the sheet layer the titleblock text show: N/A or something like that. Quote Link to comment
Neda Roohnia Posted June 10, 2022 Share Posted June 10, 2022 On 4/13/2022 at 8:05 PM, Mark Aceto said: It's a logic problem. I have a friend that has been asking for this for years, and my response has always been the same, "How would VW manage that with more than 1 viewport on the same sheet layer but not all of the viewports are the same scale?" Agreed! But what if it asks for some more criteria like class etc.? Then it can filter the main one and get the scale. 1 Quote Link to comment
Neda Roohnia Posted June 10, 2022 Share Posted June 10, 2022 On 4/13/2022 at 1:17 PM, Pat Stanford said: If you are using the Title Block Border object I don't think you can use this at all. You might be able to use a worksheet script to store the value into a Record.Field attached to your title block and then possibly use that as a text field. I don't think I fully understand what you want to be able to do. Thanks a lot, Pat. I am exactly trying to do what you mentioned in here. Trying to use the worksheet to store the value into a Record.Field attached to my title block and use it there. I just don't know how to do it! Quote Link to comment
Mark Aceto Posted June 10, 2022 Share Posted June 10, 2022 3 hours ago, Neda Roohnia said: Agreed! But what if it asks for some more criteria like class etc.? Then it can filter the main one and get the scale. I like Drawing Labels for viewport scales. Title Block just needs to say print size. 1 Quote Link to comment
Tom W. Posted June 11, 2022 Share Posted June 11, 2022 6 hours ago, Mark Aceto said: I like Drawing Labels for viewport scales. Me too. We need to be able to include a scale bar as part of a Drawing Label. 1 Quote Link to comment
Mark Aceto Posted June 11, 2022 Share Posted June 11, 2022 14 hours ago, Tom W. said: Me too. We need to be able to include a scale bar as part of a Drawing Label. @Scott Mann this is possible, right? Also, I was working on building a custom Data Tag Drawing Label in v2021 and then bailed but I need to revisit that in v2022... 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.