Jump to content

Generate Sheetlayers with Excel


Recommended Posts

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?

Link to comment

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);

 

  • Like 3
Link to comment

@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!

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