Why does moving my component off the origin cause strange behavior

Beaded Inset Door.skp (78.5 KB)

I’m trying to create a very simple cabinet door that scales without distorting the profile. To do so, I made it from 9 subcomponents and constrained the relevant attributes. When the component is placed at the origin, the scale function works as I intend, but once I move it off the origin things get strange. I can’t move it to a specific point, it seems to move in the direction I want but along a greater distance, and the scale tool changes it’s position. This doesn’t seem to be a problem when I load this file into another model as a component, but even then it does sometimes behave strangely.

I would appreciate it if someone could tell me what I’m doing wrong.

Thank You

Can you show a screen shot of what you are getting? It seems to be working fine for me. I made some copies of the door and resized them with the Scale tool and they did what I think they should do.

Door A Starts at the origin, when I try to move it so that it’s left edge is on the vertical guide, it ends at position B. Then when I try to move from position B to the horizontal guide, it ends at position C.

I see. I had imported the .skp file into SketchUp. It came in with an extra wrapper and worked fine. Hang tight.

The problem stems from having position attributes defined in the top level. There’s no reason to define those in the top level. the positions of the sub-components are based on the parent’s origin anyway.

This isn’t terribly elegant but it works. Take a look at the way it is structured. Import it into aSketchup session.
Beaded Door DC.skp (35.8 KB)

You are referencing all positions to the parent positions, better to reference to the position of an internal part (eg. bottom left) or reference to Len(X-Y-Z) of the parent. (eg. X position top right is Parent!LenX-LenX)

When creating a Dynamic Component, it takes in account the relative positions of internal parts. When you scale, these original position get scaled from that original sized ‘container’ . Adding the current Parent! position of that in a formula in the childcomponents results in these unpredictable positions because it now adds the relative positions of the child as well.

1 Like

try this one:

Beaded Inset Door (1).skp (46,4 KB)

Thank you very much! I was unaware that the subcomponents use the origin of the parent as 0,0,0. I thought they would change relative to the position of the component in a larger model.

Thank you very much! I noticed in your version of the model you didn’t constrain certain values of the subcomponents. You never set the value of the Y axis for example. How do you determine which values need constrained and which do not?

Constraining the sub-parts’s dimensions (LenX-Y-Z) ought to do it in combination with referencing an existing position of the one part that has it’s axes aligned with the Parent axes upon creating the DC.
(bottom left)
I usually flip the right part and top part so that the internal axes of these parts fit in the Parent’s initial bounding box.
Each sub-part will remember where it should be positioned when creating the DC (theoratically, you don’t need to constrain the positions of that bottomleft part, too, but it is sometimes easier to reference to)
But the positions that do get affected by scaling, need to be constrained.
You can look at it as placing ‘glue-components’ to a face and then stretching (scaling) that face.

Although some planes are hidden to scale for each individual part, when selecting more than one and scaling, all grips are there, which could lead to these kind of situations:

Thank you again! One last question before I stop bothering you.

Based on this interaction, I’ve learned that it is unwise to set the position of subcomponents relative to values in the parent component.

However, I’m assuming the same is not true of dimensions? For example, is setting the Z length value of the right stile, could be a function of the parent’s overall length along the Z axis minus the length of the 2 right corner blocks along the Z axis a valid strategy (LenZ=Beaded Inset Door!LenZ-Top Right!LenZ-Bottom Right!LenZ)

Yes. That’s a valid stretegy. I didn’t do that in my example because the corner components are fixed in size and it was easier to type 4.5 than to scroll to the corner blocks to copy their LenX and LenZ or to manually type that. If you were making a DC in which those corners would change in x and z, then it would make more sense to use those in determining the lengths of the rails.

This is a basic panel, with fixed width and thickness for the stiles, it would involve a bit more to have those changed, or the profile wil be deformed.
Check this example (blast from the past):