Jump to content
Sign in to follow this  
Pat Stanford

Script to set object Z Heights to Zero

Recommended Posts

The following script was requested by a user to move all Space objects, Doors and Windows in a drawing to a height of 0 (zero) relative to the layer they are on.

Procedure SetZHeight;

{Sets the Z Height of all Space Object, Doors and Windows}
{in a drawing to 0 (Zero) relative to the layer they are on}

{Use at your own risk on a copy of any critical data.}
{Do not use while operating heavy equipment}
{All warranties expressed or implied are null and void upon}
{reading this disclaimer}
{May cause dizziness, dry mouth or heat palpitations.}
{Use only under guidance of a physician}

{October 7, 2014}
{© 2014, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}



Procedure SetSpaceZHeight(SSZHand:Handle);

Var		ZHeight: Real;
		OldName: String;
		TempName: String;
Begin
	TempName:=Date(2,1);
	OldName:=GetName(SSZHand);
	SetName(SSZHand,TempName);
	ZHeight:=ZCoordinate(N=TempName);
	Move3DObj(SSZHand,0,0,-ZHeight);
	If OldName='none' then OldName:='';
	SetName(SSZHand,OldName);
End;


Begin
ForEachObject(SetSpaceZHeight,(((PON='Space')|(PON='Door')|(PON='Window'))));
End;

Run(SetZHeight);

Share this post


Link to post

I do a lot of copy pasting of objects between layers and there is a bug in VW which changes the z height of objects in the process. Before this script I was spending a not insignificant amount of time going into Groups of objects and manually setting everything back to 0!

Absolute gold, thank you Pat.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×