Prompt for sub-object surface selection?

I apologize in advance for probably silly questions here, I am writing my first Macro but do not know how to prompt to select a sub-object surface, is it possible? Thank you!

Dealing with sub-objects is pretty complex for a beginner… so I would avoid it for awhile until you are quite comfortable with the concepts in Rhinoscriptsyntax and RhinoCommon. You can get a subsurface index of a picked face or edge Brep with rs.GetObject() by setting the appropriate object filter and the subobjects flag to True, but that will only give you the index number and type of the subobject… You would then need to do something with this using RhinoCommon.

What are you trying to do?

–Mitch

Thank you Mitch for the prompt reply, I’m still far away from scripting, working on a Macro concept for push pull of rectangular planar faces. I wanted to initially ask the user to press Ctrl + Shift and sub-select a surface but then I wondered if it can be scripted so you can select a surface right away, do the rectangle, auto-select the last created subsurface, do the push pull and finally back again to the beginning.
This is that macro
(corrected):

! _CPlane _Object _Pause
_Rectangle _Pause _Pause
_SelLast
_Explode
_SelLast
_Splitface _Pause _Curves
_SelLast _Enter
_SelPrev _Delete
_ExtrudeSrf _Pause
_SelLast _MergeAllFaces
_SelNone

Okay I have no idea how to improve this any further,
it works quite well when the user initially selects with Ctrl+Shift a sub-object surface and than runs this macro:

! _CPlane _Object _Pause
_Rectangle _Pause _Pause
_SetRedrawOff
_SelLast
_Explode
_SelLast
_Splitface _Pause _Curves
_SelLast _Enter
_SelPrev _Delete
_SetRedrawOn
_ExtrudeSrf _Pause _Pause
_SetRedrawOff
_SelLast _MergeAllFaces
_SelNone
_SetRedrawOn

Now follows the hard part, learn how to script this with some command options…