One is to create in the work part. OK for quick and dirty, but not used a master model environment. There is an old ufunc sample in UGOPEN called ufd_cam_sample.c.
The other modern way is to create an assembly, where your CAM setup is the top level, and the components are the part, blank, fixtures, machine tool, etc. It's probably easiest to see this if you record a journal. Open a model, start recording, go to File New, Manufacturing, pick one of the setups, and the assembly is created. Stop recording and take a look at the vb.
You can include the machine tool in the setup, as we have with the sim* setup templates you see in file new. If you do this, it should be as easy as file new for your users, and you may not need the automation.