Jump to content
Developer Wiki and Function Reference Links ×

Design Layer Data into worksheet


Recommended Posts

I have an almost functional version that is displaying the Name, Description, Elevation and Scale. I don't think the Sorting Order is displayed in the OIP is available via script. The default order that you get the layers is they "inverse" of the stacking order. i.e from the bottom of the list up to the top. We could fix that in the script if necessary.

 

I have another script floating around about getting tag data that could be incorporated. If I remember correctly, all of the tags have to be read out at once. Do you want the Tag field to show all the tags associated with the layer?

 

How do you want the final output? Your list above, a space and then the list from the next layer? Or one layer in each column?

 

Can you post a file showing a few layers with your typical descriptions and tags I can use to test?

  • Like 1
Link to comment
  • 1 year later...

I'm very glad I found this thread and the Layer Manager Worksheet, it's been very handy when reorganizing sheets. @Julian CarrI have one question, is there a way to report the Sheet Title in the same way that the description is reported? It would save a lot of time to be able to change the sheet titles from the worksheet.

 

Thanks for putting this together Julian!

 

-Dylan

Link to comment

Julian, I can't thank you enough for this! 

 

We start projects on Tabloid (11x17") sized sheets during the preliminary design phases and then change sheet sized to 22x34" for constructions documents. Re-organizing our sheet layers was always time consuming. Not anymore!

Link to comment
  • 1 year later...

@Pat Stanford I found your scripts for procedures for

1) 2023 - all Layers (DL+SL in one list) to WS - Procedure Layers_to_Worksheet;

2) 2017 - Sheet Layers to WS - Procedure SheetLayers_to_Worksheet;

 

Please can't find the missing - one script only for Design layers to WS?

something like: 

Procedure DesignLayers_to_Worksheet;

 

Edited by ashot
Link to comment
Procedure DesignLayers_to_Worksheet;
{Make a worksheet listing all of the design layers in a VW file}
{Lists both used and unused layers}
{The worksheet is named "Layers:"with and appended date}
{Sorts layers in alphabetical order prior to storing in worksheet}
{March 19, 2015}
{© 2015,2010, 2008, Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}
Type	LayerData = Structure
		LayerName, Stack, Descrip, Elevation, Tag, Scale: String;
		End;
var	H1, H2:	Handle;
N1, N2:	LongInt;
R1, R2: Real;
S1: DynArray of Char;
LayerSort : Array[1..1024] of LayerData;

Begin
H2:=FLayer;
N2:=1;

While H2 <> nil do
	Begin
		If ((GetObjectVariableInt(H2,154)= 1) | (GetObjectVariableInt(H2,154)= 2)) then
			Begin
				LayerSort[N2].LayerName:=GetLName(H2);
				GetDescriptionText(H2,S1);
				LayerSort[N2].Descrip:=S1; {GetObjectVariableString(H2, 159);}
				GetLayerElevation(H2, R1, R2);			
				LayerSort[N2].Elevation:=Concat(R1);
				LayerSort[N2].Scale:=Concat('1:',GetLScale(H2));
				N2:= N2 + 1;
			End;
		H2:=NextLayer(H2);
	End;

{Add Curly Braces (comment out) the next line to not sort the layers by name}
{SortArray(LayerSort,N2-1,1);  }

H1:=CreateWS(Concat('Layers:',date(2,1)),N2+6,6);
For N1:= 1 to  N2 do 
	Begin
		SetWSCellFormula(H1,N1+2,1,N1+2,1,LayerSort[N1].LayerName);	
		SetWSCellFormula(H1,N1+2,2,N1+2,2,LayerSort[N1].Descrip);
		SetWSCellFormula(H1,N1+2,3,N1+2,3,LayerSort[N1].Elevation);
		SetWSCellFormula(H1,N1+2,4,N1+2,4,LayerSort[N1].Scale);
	End;

SetWSCellFormula(H1,1,1,1,1,'Layers in File');
SetWSCellFormula(H1,2,1,2,1,'Layer Name');	
SetWSCellFormula(H1,2,2,2,2,'Description');	
SetWSCellFormula(H1,2,3,2,3,'Elevation');	
SetWSCellFormula(H1,2,4,2,4,'Scale');	

ShowWS(H1,True);

End;

Run(DesignLayers_to_Worksheet);

 

  • Like 1
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...