# SubComponent doesn't get the transform of a the parent Component instance?

**URL:** <https://forums.sketchup.com/t/subcomponent-doesnt-get-the-transform-of-a-the-parent-component-instance/25012>\
**Category:** SketchUp SDK\
**Created:** [May 11, 2016, 4:13pm UTC](https://forums.sketchup.com/t/subcomponent-doesnt-get-the-transform-of-a-the-parent-component-instance/25012 "2016-05-11T16:13:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LBarret](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@LBarret](https://forums.sketchup.com/u/LBarret)\
**Post date:** [May 11, 2016, 4:13pm UTC](https://forums.sketchup.com/t/subcomponent-doesnt-get-the-transform-of-a-the-parent-component-instance/25012/1 "2016-05-11T16:13:36Z")

</div>

I may be missing something there.

In my code, I use one or more componentInstance of a root componentDefinition and I enrich this root componentDefinition with (sub)componentsInstance. It works well but the transform doesn’t seem to be correctly managed.

When I add a new componentInstance to this root componentDefinition, the new instance doesn’t get the transform and seems added to be in global space. Color me puzzled.  
Here follows the code I use:

```
    // Create a component instance.
    SUComponentInstanceRef instance = SU_INVALID;
    SUComponentDefinitionCreateInstance(node_definition, &instance);
    SUComponentInstanceSetName(instance, node_name.c_str());

    // Get entities of the root component.
    //https://www.sketchup.com/intl/en/developer/su-api/component__definition_8h.html
    SUEntitiesRef entities = SU_INVALID;
    SUComponentDefinitionGetEntities(current_root_definition, &entities);

    // Add the new component instance to these entities.
    //https://www.sketchup.com/intl/en/developer/su-api/entities_8h_source.html
    SUStringRef out_string_ref = SU_INVALID;
    SUStringCreate(&out_string_ref);
    SUEntitiesAddInstance(entities, instance, &out_string_ref);

```

---

<div class="post-metadata">

**Author:** ![LBarret](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@LBarret](https://forums.sketchup.com/u/LBarret)\
**Post date:** [May 11, 2016, 8:05pm UTC](https://forums.sketchup.com/t/subcomponent-doesnt-get-the-transform-of-a-the-parent-component-instance/25012/2 "2016-05-11T20:05:15Z")

</div>

ok, forget this one. Another shady part of our framework was bypassing this. My apologies.
