m = Sketchup.active_model
d1 = m.definitions.add("个组件定义")
c1 = m.entities.add_instance(d1, IDENTITY)
g1 = c1.definition.entities.add_group()
puts("组的父母是#{(g1.parent == d1) ? "组件" : (g1.parent == m) ? "模型" : "?"}: #{g1.parent}")
> 组的父母是组件: #<Sketchup::ComponentDefinition:0x000000161a18f8>