Parameterise Geometry

Have some geometry to parameterise. Here we have two cubes and we want to parameterise the height of the left one. ​

Transparent

On the Groups tab, create a Script Parameter and a Script Group:​

Transparent

Right-click your script and select Edit Script. In the scripting window click the Record button and do the operations you want. Here, we wanted a Pull with a reference and then a Shared Topology:​

Transparent

Two recommendations here is to click the little arrow next to Insert Selection and set it to Index, and always use a reference when using Pull.

The script parameters are saved in the object Parameters, and the name of my script parameter is ParameterS, so changing the 30 into the script parameter looks like:​

Transparent

# Extrude 1 Face
selection = FaceSelection.Create(GetRootPart().Components[1].Content.Bodies[0].Faces[2])
reference = FaceSelection.Create(GetRootPart().Components[1].Content.Bodies[0].Faces[3])
options = ExtrudeFaceOptions()
options.ExtrudeType = ExtrudeType.Add
result = ExtrudeFaces.SetDimension(selection, reference, MM(Parameters.ParameterS), options)
# EndBlock
 
 
# Share Topology
options = ShareTopologyOptions()
options.Tolerance = MM(1)
result = ShareTopology.FindAndFix(options, Info1)
# EndBlock