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.

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

Thanks so much for the timely response! I'll give it a try.

Hi,

Yes there are nodes that round up the digits,

To round up or down just need to do a bit of maths with the nodes .

If x<0.5 round down and if x>=5 round up

Edited by Alan Woodwell

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.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• KBASE
• MARIONETTE

×
• Create New...