fjtb Posted July 5, 2020 Share Posted July 5, 2020 Hello, Is there a way to generate automatically sheet layers based on an Excel sheet? Cheers, Frans Jan Quote Link to comment
Pat Stanford Posted July 5, 2020 Share Posted July 5, 2020 I don't know of a built-in way to do it, but it would be relatively easy to export the excel file as text and import that file (or just bring it into a worksheet) and then use the data in the excel file to generate sheet layers. What information do you have in the Excel file that you want other than the layer names? Quote Link to comment
fjtb Posted July 8, 2020 Author Share Posted July 8, 2020 Hi Pat, thanks for this, I’ll give it a try. I need to create around 188 sheet layers, one for each item, which is related to a specific venue. cheers, Frans Jan 1 Quote Link to comment
Pat Stanford Posted July 9, 2020 Share Posted July 9, 2020 You will still need a script to do it. Without a script all you will have is a list of the names you want. Get the list of layers into a text file with one name on each line in the file. Run the script and navigate to the text file and click Open. In seconds you should have each of your Sheet Layers in the file. To use the script go to the Resource Manger and New Resource:Script. Name the Script Palette and Script when asked to. Copy and paste everything in the text block below into the script editor window. Click OK. Double Click on the script in the Script Palette to run the script. HTH Procedure CreateSheetlayersFromTextFile; {July 8, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {No Warranty Expressed of Implied. Use at your own risk. Here be dragons.} Var H1:Handle; SourceFile:DynArray of Char; ThisName:String; Begin GetFile(SourceFile); Open(SourceFile); While Not EOF(SourceFile) do Begin ReadLN(ThisName); H1:=CreateLayer(ThisName, 2); End; Close(SourceFile); End; Run(CreateSheetlayersFromTextFile); 3 Quote Link to comment
unearthed Posted July 14, 2020 Share Posted July 14, 2020 @Pat Stanford Jo Pat, would this work in 2012? When I tried to run it i get an error: Line #13: GetFile(SourceFile); | { Error: Argument is not the expected type. } Line #24: Run(CreateSheetlayersFromTextFile); | { Error: Expected a RUN statement at the end of the scirpt } --------- Yes, the spell error is in the error msg! Quote Link to comment
Pat Stanford Posted July 15, 2020 Share Posted July 15, 2020 I don't have 2012 installed anywhere to test, but I don't think I used anything that was not available in VW2012. Make sure you have copied EVERYTHING in the code block. You need the Procedure line at the top and the Run line (including the semicolon at the end) at the end. 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.