Drag / scale?

I have this 1x1 diagonal component set up to where you place it and then enter in a width and height in the component options. Is there a way to set it up so that you place it and then drag it to the width and height (if that makes sense)?

diagonal.skp (82.5 KB)

You could perhaps just use the Scale tool.

In principle, yes, by setting the Behaviour/ScaleTool attributes in the DC. But if you do set that up, why not use the native Scale tool? Or do you want to restrict the scaling to only one or two dimensions, which you can do in a DC.

Like this, for example:
diagonal JWM.skp (100.5 KB)


This shows only scale handles for up/down (Z or blue direction), left/right (X or red direction) or both together (in XZ/red and blue plane).

EDIT.
I wrote originally “Of course, that scales the thickness of the strut as well.”

But because of the clever way you have created the geometry the strut stays 1" square, even after scaling to width and height.

Things go a bit wrong if the width and height are too small (3" x 2" for example).

The diagonal and end triangles stay in the correct relationship until the width or height go below about 2.3 inches.

I tried to understand the detail of your calculations but found it slightly too difficult to be worth the full effort it would take.

I got as far as labelling a diagram with the names and values of your variables for a 30" x 20" diagonal.


diagonal JWM.skp (270.0 KB)
And I follow the maths thus far.

But I’m puzzled by the calculation of the LenX of the diagonalstraight component as =Diagonal!LenZ-Diagonal!tri2hipc

tri2hipc is calculated as the hypotenuse of the small right triangle, but I think you should subtract the shorter side of that triangle, not the hypotenuse.

A very interesting exercise to follow your calculations, even if I haven’t quite understood it all.

PS. Changing the formulae to replace Diagonal! by parent! or Parent! would allow you to rename the DC without breaking the formulae.

PPS. It would be an interesting exercise for you, and an even more useful DC to have, if you made the width and thickness of the strut into Component Options, and updated the calculations where necessary to replace the fixed 1" by either width or thickness as appropriate.

1 Like

I believe the scale feature itself will work if I fix the way the end angles are placed in the component, they seem to be blowing out the bounding area when you initially try to insert. THANK YOU I overlooked the Xvalue subtracting the wrong number, I wondered why my length was slightly off. I’ll take a look at your other suggestions when I get back to my work Computer on Monday. Thanks everyone.

I’ll have to play around with this more but I added a couple vertical pieces to aid in alignment and to make scaling smoother. For my use they get covered up by verticals. I had not used the behavior/scale tool before but that seems to work the best for my purposes.

I’m curious about why you need the vertical pieces? And if you do need them, why they get covered up? Your maths should be fine once you fix the diagonalstraight LenX calculation.

And snapping the scale tool to an inference point won’t work accurately if any part of of the DC is outside the strut itself.

I’d be interested to see the revised version, if you would upload it when you are happy with it.

I could be overlooking a completely simple solution to this but this seems to be the issue to me. My end angles are pushing out the bounding area and I couldn’t figure out how to rework them to get around that:

One way round that might be to re-set the triangle’s axes so that one is along the hypotenuse. At least that would keep the bounding boxes of the triangles inside the opening width.

image

For example, with the triangle’s axes the same as the model, not the diagonalstraight.

Of course, that then screws up the maths. But you should be able to overcome that, though it would be tricky I think.

So it seems like I would need to figure something like this to get my lengthX and Z in order to keep the end angle triangle as a right triangle:

Not quite. From the overall diagonal length you’d need to subtract the length of the top sloping side of your red triangle, to get the length of the diagonalstraight.

I think it’s easier to understand if you look at the bottom right, not the top left, of the straight.

Ok, I was making this way more complicated than needed basically I just split the end angle piece into two separate triangles and hid the line between. I have not yet had a chance to explore some of your other suggestions but here is the updated model:diagonal.skp (87.8 KB)

On a quick look late in the evening here, it looks good and clean.

Why did you need to add two triangles at each end?
image

Not difficult to add the ScaleTool feature.

I’ve done that, but slightly bothered by the result. Didn’t get what I expected in the Component Options box.

If I use the vertical scale handle, and type the height value of 22", the measured height is correct, but the Component Option height value didn’t change.

It seems it needs a redraw to show the correct value.

And until I perform the redraw, the strut doesn’t resize to 1" square.

diagonal JWM.skp (119.3 KB)

I suspect this is a feature of DCs, not a bug.

The plan is to use the diagonal when I am using an older dynamic model where I had not automated the diagonal placements or if I am drawing a frame from scratch rather than using a dynamic model. This is what it looks like placed on the frame: