New to scripting, How can I script a closed curve and extrude it?

Hi Everyone, I am very new to scripting in rhino and I am trying to figure out how I can get user input to draw a closed curve, a box, and then extrude it to a user inputted height?

Would I use import rhinoscriptsyntax at all for this script?

Sure. First, there is no rhinoscriptsyntax native function to prompt the user to draw a curve, so you would need to script that with rs.Command() and one of the Rhin native curve creation commands. Then you would be able to get the ID of the just created curve with rs.LastCreatedObject() and use one of the rs.Extrude... methods to extrude the curve. Which extrude method you choose might depend on what direction you want the curve to be extruded, probably rs.ExtrudeCurveStraight() would be the easiest, as it just wants two points to determine the height. There is also the question if you want to cap the object or not to make a solid, in that case you probably need to test the input curve to see if it’s planar and closed first, otherwise the cap operation will fail…