Can anyone tell me what I'm doing wrong, and why Sketchup is arguing with itself on DC dimensions?

Component Attribute Test.skp (5.6 MB)

Not sure what you are expecting to see with the dimensions. But there is a small gap on the right hand side in the file you uploaded, where the side of the cabinet should presumably be up against the base of the cabinet?

image

That gap was created by scaling the model. Try scaling it, and see what happens. I’ve re-done a number of models, and can’t figure out what I’m doing wrong. Whether I’m doing something wrong, or not, you will not that the dynamic dimension updates properly, but the x value in the component attribute section does not. That can’t be me.

place axis at the corner of panel

each level is in refence to its parent axis, so reference to component#15!x not required, otherwise moves extra

2 Likes

Do you need such detail, cabinet can be block with hole

Component Attribute Test.skp (102.7 KB)

I’ve found that an absolute value, or a referenced value works for the x position. So the left edge of the bottom is always correct. It is the right edge that is always wrong when scaling the model.
Then there is the issue of the x value of the parent component. It is wrong … why?

yes fixing the X value to 0.75 and removing any other reference true

if you move the parent on X, currently you move the child a the same again

It’s my understanding that the right edge of the bottom will be adjusted automatically when scaling. Of course, this would seem to be impossible if the x value of the parent is wrong when the model is scaled. Look at the x dimension value of the model. It is correct, so why is the x value in the parent component attributes wrong. Try scaling it and see what happens.

the levels are containers, the contents move with the container, like shopping in a bag, if you add on the parent or container X position it will move beyond the basket by that distance. Remove this reference

1 Like

Not sure what you’re saying here, but I tried a different way of constructing the same model, and got very different results. So it appears that how the component is put together makes a difference. I’m not sure I really care, because I can’t imagine using this feature in my work. For instance, if I construct a 48" bathroom vanity, and want to extend it to 60", I edit the component, window the entities at one end, and move them over 12". I religiously avoid using the scale tool to change dimensions, unless all lines are parallel, and all angles or 90 degrees. Even then, I prefer to use the edit/window method.

Like you, I wouldn’t take the time to make a DC for something like a custom vanity. If the client changes their mind and wants a different length it’s easy enough to modify the thing without scaling anything. Most of the casework and furniture I do is one-off custom stuff and rarely do I reuse wooden components in later models. I find DCs useful for some things. For example I have a client who uses Blum undermount drawer slides in his cabinet work. I created a DC for the drawer boxes that can be sized using the opening width and height and the cabinet depth based on Blum’s guidelines for the drawer glides.


There is no need for any joinery detail in this component nor for the notches in the front and back for the glides. I enter the dimensions in the fields with the white background and the box gets sized accordingly. The numbers in the fields with the gray background are given to the drawer box manufacturer for pricing and ordering.

The drawer box component’s origin is placed as you see there so that the drawer box goes into the case exactly where I want it with the insertion point (origin) located at the lower left corner of the opening.

The positions of the five sub-components are from that origin. If I change to inset drawer front you can see that the sub-components shift back by the thickness of the false front.

The position values for the sub-components are based on their own origins relative to the drawer box component’s origin. The SideR component’s origin is at the lower front right corner of the component. The sides of the drawer box are 1/2 in. thick so PosX for the right side is basically half an inch less than the length of the box front length.

All of the functions for placing your sub-components in the model have to be relative to the top level component’s origin. If you included anything in the top level component that does any math to the position of the component, it’ll move everything inside.And if you then add a position function to the sub-components that references the function for the top level component you can wind up with things moving in strange ways.

In my drawer box component there are no functions added to the top level component. The position of the drawer box component within the model is unimportant in terms of the locations of the sub components so there isn’t even a reference to PosX, PosY, or PosZ in the parent component.

1 Like

I thoroughly appreciate your detailed explanation of how this works. If I feel the need in the future, I will take the time to master it. For the most part I tend to be a control freak and prefer to avoid letting a piece of code doing my work for me. There are obviously times when a chunk of code will greatly enhance one’s efficiency, but if I can do it myself, I know it’s done correctly. Not only do I know it’s done right, but actually faster. A good example is the Profile Builder extension. I can beat what it does using Sketchup’s native tools, and I don’t make some of the odd layout choices that Profile Builder does.