Hi Gert,
As far as I know a user-defined feature is deleted when it looses it's last reference. This would mean that the second case doesn't occur.
You could check the existance of a user-defined feature if you have the name of the parent part and the name of the feature with the function (sd-inq-part-named-features part). Parse the resulting list if a feature of the desired name is in the list or not.
This proposal is not very comfortable. Another possibility is to use the build in selector functionality. The syntax to select a user-defined feature you can for instance get with a recorder file. Start a recorder, double click the icon for an existing user-defined feature, stop the recorder and check the result with a text editor. Now replace the part and feature name with your names and pass the complete string to the dialog get_selection. A description for get_selection syntax you can find in the integration kit documentation. If the result is nil then the feature doesn't exist. In the other case you get a sel_item.
In principle your code could look like this:
(setf my-feature (sd-call-cmds (oli:get_selection :focus_type oli:*sd-feature-seltype* :select :FULL_NAME :START_NAME "/cube" :FEATURE "feat1" :END_NAME )))
Hope this helps,
Dorothea