Adding Right Click menus for Cogo Points, Surfaces etc. does not necessarily need to be done though the API.
It you want to add a menu for Tin Surfaces only, you can do it in the CUI editor by -
Expand the Shortcuts Menus node
Right Click on the Shortcuts Menus node and choose New Shortcut Menu
Name it Tin Surfaces (or something useful)
Click on the new Shortcut Menu
On the right hand side, click in the Aliases box
Click the Ellipsis button on the right hand side (box with 3 dots)
Enter OBJECT_AECC_TIN_SURFACE on a new line and click the OK button
Add your commands to the new shortcuts menu as you like and click ok to get out of the CUI Editor
When you select a tin surface in civil 3d, it uses the above created shortcuts menu and adds them to the generic shortcuts menus - see the attached screen shots.
The name you use in the alias box is the name of objects that are matched against by civil 3d when you select something and right click. You can get the names to use for other objects by selecting one of them and typing list on the command line. For tin surfaces you will see AECC_TIN_SURFACE. Add OBJECT_ to the front of that and it will work. Cogo points show AECC_COGO_POINT in the list command so you would use OBJECT_AECC_COGO_POINT for the shortcut menu alias.
Attached are screen shots of the Tin Surface shortcut menu in the cui editor and the menu as it shows in model space.
If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.
Andrew Puller
Maitland, NSW, Australia
Windows 11
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2023