Use model.component(<ctag>).geom(<tag>).create(<ftag>,"CompositeDomains") to form composite domains.
Use model.component(<ctag>).geom(<tag>).feature(<ftag>).selection("input") to select the domains to composite. The default selection is empty.
Use ignoreadj to specify if the feature also removes the ignorable edges (3D only) and vertices on the boundary of each resulting composite domain.
Use keepformesh to keep the input domains while meshing, to help you in constructing the mesh.