Jump to content
Developer Wiki and Function Reference Links ×

Scale all design layers


Alessio

Recommended Posts

It's possible.

 

I had an existing script that deals with layers, so I've recently wrestled with the fun eccentricities of layers (For VW the first layer is the bottom designer layer to the top designer layer, then the next layer is the top sheet layer to the bottom sheet layer.)

 

This is a quick stab at it.  I tested it and it seems to work.

 

 

PROCEDURE SetAllScaleTo100; 

VAR
	
	LayerInQuestion
	:HANDLE;

	LyrTypInt, Counter, HowManyLayers  
	: INTEGER;


BEGIN 								{**** MAIN ****} 
	Counter := 1;
	LayerInQuestion:=FLayer;
	HowManyLayers := NumLayers;

	For Counter := 1 to HowManyLayers DO			{Step through every layer, including Design Layers}
		BEGIN

			LyrTypInt := GetObjectVariableInt(LayerInQuestion,154);

			{***************************************************************************}
			{Layer type 1 is a design layer.  
			It counts them from the bottom of the stack to the top.}

			IF LyrTypInt = 1 THEN
				Begin
				SetLScale(LayerInQuestion,100);
				End;

			{***************************************************************************}
			{Layer type 2 is a Sheet Layer
			Sheet Layers are counted by stacking order from top to bottom.}

			IF LyrTypInt = 2 THEN
				BEGIN
				END; {If LyrTypInt is 2 (i.e. Sheet Layer}
			
			{***************************************************************************}			
			
			LayerInQuestion:=NextLayer(LayerInQuestion);
		
		END; {1 to number of layers}	

END; {main} 

RUN(SetAllScaleTo100);

 

 

 

  • Like 3
Link to comment

Nice Michael.  I was going to throw something together. I would have not bothered with the counter and just used a While LayerHandle<>nil to control the repeating.

 

Completely untested and typed here:

 

Procedure SetLayerScale;

Var	H1:Handle;

Begin
	H1:=FLayer;
	While H1 <> Nil do
		Begin
			If GetObjectVariableInt(H1,154)=1 then SetLayerScale(H1,100);
			H1:=NextObj(H1);
		End;

Run(SetLayerScale);

 

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