Of course this is possible. But to understand components, you have to understand Parts. Unfortunately, nobody really understands parts, but we keep trying :). So: first deselect all filters in the Capella Project Explorer: Quick Filters->Deselect All Filters.
Now you will see that for each Component, in your case “Cabin”, there will be an additional Object next to it, labeled “Cabin : Cabin”. This is the Cabin Part. When you create a Component, you must also make sure that that Part object next to is also created properly. Maybe Capella does it automatically, but maybe it doesn’t work if you do it in Groovy. So, how to actually create the Component:
First you find the parent component, parent. And then:
PhysicalComponent myNewComponent = PaFactory.eINSTANCE.createPhysicalComponent()
If that doesn’t trigger creation of the Part, you create it in a similar fashion:
Part p = CsFactory.eINSTANCE.createPart();
Something similar to this should do the trick. Feel free to DM me again if you need more help.