# Constrain subcomponent to a point

I have a component that represents a stereo speaker positioning. I want to be able to resize the component and have the speaker plane get bigger, while having the speakers stay the same size. Also, I want the speakers to move with the plane as it is being resizes and stay on the end point of the triangle. Any help is much appreciated. I included a video and an skp below. Thanks!

speaker+plane.skp (55.3 KB)

Speakers.skp (56.3 KB)

Nate, I have Go. No extensions. I could not do this just using scale. I first drew guidelines. I moved the speakers with the move tool to the guide points. Finally, I used the scale tool to move one side on the triangle at a time to connect to the speakers. Not what you want but all I could do with Go.

Thanks for your effort! Iâ€™m already aware of doing it manually like this. I would really like to have the component be able to scale all as one and have it work the way I described at first. I believe that requires some attribute formulas that I am unaware of.

I would fix the position of the left hand speaker and position the right hand one at the width of the base of the triangle. For the triangle set LenY to =((SQRT(3)*LenX)/2) to keep it equillateral. You could create a text box or dropdown list to specify the distance between speaker centers which would then modify Position X forr the right hand speaker and LenX for Component#1 (the triangle).

1 Like

Thanks for the help! I sort of understand your response, but theres some things Iâ€™m missing.

1. How should I fix the position of the left speaker? Also, if the speaker is fixed to a position, wouldnâ€™t that mean it canâ€™t be moved to accomodate for different sizing and that the component canâ€™t be moved around?

2. When you say â€śposition the right hand one at the width of the base of the triangleâ€ť, do you mean to simply have the speaker on that point, or should I add an attribute to make the speaker automatically size to the width of the triangle?

If Iâ€™m correct, the solution you are proposing is this: have a dropdown where you select how far apart the speakers are. After selecting, the triangle plane and the speakers are automatically resized to accomodate for that dimension. If I could get my model working like this, that would be amazing. I am just lost on what attributes to add, what to add them to, and what formulas to use for this.

If you could give me some more guidance that would be great. It would be perfect if you could send a .skp of this if you can get it working, but I understand if thats too time consuming. Thanks again!!

Basically it means that the position of the right speaker and the triangle are based off the position of the left speaker within the component. It doesnâ€™t mean that you canâ€™t resize the speakers or move the entire component around the model space.

I mean that the right hand speaker should be positioned at the corner of the triangle. If the speakers are placed farther apart, the base of the triangle would get longer and if the height of the triangle is set based on the length of the base, the triangle will remain an equilateral triangle as you currently have it.

If the speakers need to get larger as they get farther apart, add the attirbutes to the speakers to make that happen.

That would be one way to do it. You could also use the Scale tool on the overall component. You could just create a text field so the user can type in the distance.

I think @pcmoor would be better equipped to give you all the exact details.

1 Like

Ya thanks so much for the reply and help. I donâ€™t need to worry about the speaker size changing, I want them to stay the same. Everything you proposed sounds great though. The only problem is that I am pretty inexperienced in the component attributes section and knowing what attributes to add and adjust. If I can get more help on that itâ€™d be great.

Iâ€™m gonna mess around and see if I can get it working though. Thanks again for the help and please let me know if theres anything you can do to further assist me! Hopefully @pcmoor can add his touch.

Here is an updated version of what I was working on with the tips you gave me. Still some errors for sure, but I can see potential with some help.