rowbear97 Posted July 27, 2016 Share Posted July 27, 2016 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. Quote Link to comment
michaelk Posted July 27, 2016 Share Posted July 27, 2016 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 Quote Link to comment
rowbear97 Posted July 27, 2016 Author Share Posted July 27, 2016 Thanks so much for the timely response! I'll give it a try. Quote Link to comment
AlanW Posted July 27, 2016 Share Posted July 27, 2016 (edited) 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 July 27, 2016 by Alan Woodwell Quote Link to comment
Recommended Posts
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.