Making a triangle respond to... Shapesheet question here...

Started by jamtart, December 17, 2008, 06:40:48 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jamtart

I need to find a way to have two triangles in a composite drawing add together so that a third triangle is the result of the first two triangles. In my attached example the green and gray triangles must be added together to get a resultant triangle (blue). Hope someone can help me out with this one.

wapperdude

This can be done with formulas, once the relationship between the triangles is determined.  It looks like the areas of the green and gray triangles are added to get area of resultant triangle.  Only problem, the short side of the blue triangle looks to be in error, s/b 35.41?

The necessary formulas can be entered into the shapesheet of the blue triangle, which references the geometry of the green and gray triangles.  But, before that can be done, still need to know what the relationship is between the 3 triangles.  If you have an equation or formula, it's relatively easy to add it the shapesheets.  Then, as you change either or both green/gray triangles, the blue will adjust accordingly.

Wapperdude
Visio 2019 Pro

jamtart

At the moment the Blue triangle is not correct, i knew that. the blue triangle is all the Watts of the green and grey added together and the Vars of the blue are the Vars of the green minus the vars of the grey. the hyponenous  is pathagareum therum of the resultant watts and vars. The angle of course should just follow along. I will have to give this a try tomorrow at work.

vojo

Be careful...this is going to get far more complicated than you think, assuming you want the new triangle to be the sum of the areas of the old triangle.   You are going to have to add the individual areas to get new area then work back to get base height then translate (assuming isosoles (sp) or right triangles) to get the 3 lines of the new make it all work out.  Moreover, since two variables (base and height) I think you will have to make some assumption on their relationship (base = 2* height or something like that).

Definitely sounds like a VBA macro

jamtart

Been banging my head against the wall on this one. Realized that just from the way I have the diagrams laid out that I dont need to worry about the horizontal calculations, just the vertical one. ShapeSheets are not my forte :-[

wapperdude

To do this simply, (avoiding most math), here are the assumptions: 
1.)  Drawing is always as you've shown
2.)  Green triangle can only go negative or to zero
3.)  Gray triangle can only go positive or to zero
4.)  The blue height is just the sum of the other two.

For simplicity, I'm assuming that the only shapes on the page are the three triangles.  For even greater simplicity, assume that they were drawn in this order:  green, gray, blue:  that way, green will be shapesheet 1, gray #2, and blue #3.  (If not, then, you need to go to View > Drawing Explorer > Foreground pages>shapes.  Click a shape and it will be selected, and that tells you its shapesheet id.)

Open the blue triangle shapesheet.  In the 1st section, Shape Transform, make the following entries:

1.)  LocPinY => Height*1.  Note, this will shift the triangle in the drawing, just re-position it to where it needs to be.

2.)  Height => guard(sheet.1!height-sheet.2!height)

That's it.  Close the shapesheet.

Now as you drag the green/gray triangle's height, the blue will follow.

Wapperdude
Visio 2019 Pro

jamtart

All your assumptions are correct wapperdude. Triangle green one seems to be called "Rt. triangle: 2 legs" the gray one "Rt. triangle: 2 legs.2" and the last one (blue) is "Rt. triangle: 2 legs.3" It appears that I may be able to rename these guys here too but I will save that for a later time.
Gonna give what you said a try here and get back to you.

wapperdude

Should work fine.  You can always use cntl-Z to undo, or worst comes to worst, close without saving and re-open the drawing. 

If you're still stuck, I can provide a drawing file, but, give it a go first.
Visio 2019 Pro

jamtart

Had to close a few times without saving already :-[
The LocpinY one really seems to mess up the drawing... Will keep plugging away though.

jamtart

Well I got some interesting results doing this, not quite there yet LOL. I will have to put it aside and try again later... ::)

wapperdude

OK.  I'm going to be on/off, so, here's a solution.  Open when/if you need to.  It also takes care of the widths.
Visio 2019 Pro

jamtart

No matter what I do I just am not getting what I need, close though... :-[

wapperdude

Perhaps it's time to look at the file I sent.  Most likely, it's something subtle.  If all else fails, attach your file.
Visio 2019 Pro

jamtart

I left the file that I was working on at work but I have the orginal here, already posted. Your example is so close to what I need to do. The vertical works great but the horizontal is not quite right. For example when I expand the brown triangle to the left the blue triangle expands to the right. I am sure that the horizontal value of the blue is the combination of the other two, but the blue left point must stay put with the brown left point. Hopefully that makes sense. I need numerical values eventually too. FYI, I am hoping to use this as a teaching tool/illustration for my students. And the creation of this is a learning tool for me, lol.
Thank you for what you have attention on this project of mine.

vojo

pretty solution specific....base of triangles have to be the same...triangles have to be the same type...etc

for you app...maybe fine to cut all these corners...but not for general use.