Jump to content
Developer Wiki and Function Reference Links ×

Changing Z Values


Recommended Posts

I have a sloppy file from Microstation to AutoCAD to Vectorworks and in this file there are topographic contours that come in slightly off the Z elevation they should be. Is anyone aware of a Marionette script that I could use that would round either up or down to the next whole integer? Any assistance on this would be greatly appreciated.

Link to comment

I don't have a marionette, but this old fashioned script will move 3D polys to the nearest Z foot.

If you want the nearest inch just delete the lines

	
DistanceFromFoot := RoundedpZ MOD 12;

IF DistanceFromFoot < 6
	THEN Move3DObj(h,0,0,0-DistanceFromFoot)
	ELSE Move3DObj(h,0,0,12-DistanceFromFoot);

Procedure Move3DPolytoNearestZFoot;





Var	

pX, pY, pZ			: REAL;
RoundedpZ			: LONGINT;
DistanceFromFoot 	: INTEGER;


Procedure StopBeingSloppy(h : HANDLE);
Begin

GetPolyPt3D(h,1, pX, pY, pZ);
RoundedpZ := (Round(pz));

Move3DObj(h,0,0,(RoundedpZ-pZ));


DistanceFromFoot := RoundedpZ MOD 12;

IF DistanceFromFoot < 6
	THEN Move3DObj(h,0,0,0-DistanceFromFoot)
	ELSE Move3DObj(h,0,0,12-DistanceFromFoot);


End;

{Main Program}	

Begin


ForEachObject(StopBeingSloppy,(((SEL=TRUE))));
End;


Run(Move3DPolytoNearestZFoot);





hth

mk

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