You must first get the UI instance as follows:
UI userint = NXOpen.UI.GetUI();
Then the userint object has functions that will allow you to get the selected objects such as:
NXObject obj1 = userint.SelectionManager.GetSelectedObject(0);
I am trying to get a user selected sketch to perform actions with using the c# api. How do you get the Sketch object just by the user selecting it interactively?