In general, you sould look at the NXOpen:DM classes for these kinds of needs.
Regarding the need to create a custom item type, there isn't any problem with for example the part builders NXOpen:DM:artFromPartBuilder.
If you've got some need to impart part or dataset, you'll find some methods in NXOpen:DM subclasses.
The need to create relation between two items is more tricky. As far as I know, you do not have any direct solution. When I encountered this need a while back ago, I had to use a custom ITK handler triggered by my NXOpen automation with UF_UGMGR_invoke_pdm_server().
It's not light but it's working really well.
PS : the smiley stands for : and P, do not how to change this...
I am very interested with your UF_UGMGR_invoke_pdm_server() method
Could you give an overview of your construction ?
There are two parts.
In NXOpen :
* Creation of a string with needed informations. For example, I gathered an Item, an ItemRev which where designed to be "receiving data", and another Item and ItemRev which where designed to be paster under a specific relation linked to the first Item. Moreover some part of that string contained data I wanted to store in a CSV Dataset in Teamcenter;
In ITK :
* Parse the string in order to understand data.
* Get back needed Item/ItemRev.
* Create a CSV based on sent information.
There might have been a more clever way especially regarding the full CSV information sending through this bridge. I think I recall the string you can send shoud be less than 600 characters. Yet, it worked for me.
This was before Nx11 and the implementation of NXOpen:DM::FileManagement::ImportFilesAndCreateDatasets() which may fill your needs !