July 9, 2021 at 5:26 am
Subscriber
I used this but any suggestions to make it better are welcome.
import math
zvalue = 12
face_z = GetRootPart().Bodies[1].Faces[4].GetFacePoint(0.5,0.5).Z
selection = Selection.Create(GetRootPart().Bodies[1].Faces[4])
if zvalue>0 and math.fabs(zvalue-face_z*1000) != 0:
anchorPoint = Point.Create(MM(0), MM(0), MM(zvalue))
upToSelection = Selection.Create(SketchPoint.Create(anchorPoint).CreatedCurves)
rename= RenameObject.Execute(upToSelection,"center")
options = ExtrudeFaceOptions result = ExtrudeFaces.UpTo(selection, Direction.DirZ,upToSelection,anchorPoint, options)
Delete.Execute(Selection.CreateByNames('center'))
import math
zvalue = 12
face_z = GetRootPart().Bodies[1].Faces[4].GetFacePoint(0.5,0.5).Z
selection = Selection.Create(GetRootPart().Bodies[1].Faces[4])
if zvalue>0 and math.fabs(zvalue-face_z*1000) != 0:
anchorPoint = Point.Create(MM(0), MM(0), MM(zvalue))
upToSelection = Selection.Create(SketchPoint.Create(anchorPoint).CreatedCurves)
rename= RenameObject.Execute(upToSelection,"center")
options = ExtrudeFaceOptions result = ExtrudeFaces.UpTo(selection, Direction.DirZ,upToSelection,anchorPoint, options)
Delete.Execute(Selection.CreateByNames('center'))