Find balance point?

Z

zulu

I have a Visio page with several randomly placed different shapes, all of
different (in the real world) weights.

How can I move them around to make a certain point on the drawing the
balance point (the centre of gravity)

i.e. :


2oz 4oz 12oz
6oz

3OZ

required balance point>>> x

5oz


Is it even possible with Visio 2002?
Alternatively, is there any software available?


I hope someone can help! :)
 
V

vojo

The only way I know of is to group the objects and use user cells at the
group level to define placement of each shape. I assume you want to move
the shapes such that moving shape 1 to the left causes shape 3 to move the
right. Assume that is what you want, you will have to get pretty slick with
SETATREF function in the shape cells (ie echo the pinx,piny of the shape to
the groups user cells...then have
fcns in the group user cells to define where shape 3 goes) SETATREF is a
very powerful but very complex function....suggest you play with it some to
get hang of it before doing what you really want.

BTW...visio has never been great at "shape awareness". Ie there is not a
way for two shapes not in a group to be aware of each other without alot of
VBA code.
Personally, I would think it would 100000% more important for awareness than
all the "data interlock" stuff 2007 provides (just a cleaner way for what
2003 does). But that is just my 2 cents.

If you go down the VBA path...you can do all kinds of things...but have to
wrestle with security or complexity(if you try to use C++ for this), etc
issues.
 
Z

zulu

vojo said:
The only way I know of is to group the objects and use user cells at the
group level to define placement of each shape. I assume you want to move
the shapes such that moving shape 1 to the left causes shape 3 to move the
right.


No, I want to move the shapes around individually, some in only X axis and
one in particular in only Y axis. I should have been more clear, sorry.
Let me try again....I'l use abc etc for the wights, and CG for the
(immovable) balance point.
<> = monable in X axis, Y = moveable in Y axis





Y




A(fixed, tied to CG)-------CG <B> <C> <D>






Programming of any sort is way beyond me, and I am also very partially
sighted, which doesn't help too much (!)

I guess I am going to have to do this physically, with real weights....
I realised my question was a long shot, but it wouldn't be the first time I
missed something very obvious!!

Thanks for tryimg. :))

--
¦zulu¦






Assume that is what you want, you will have to get pretty slick with
 
P

Paul Herber

I have a Visio page with several randomly placed different shapes, all of
different (in the real world) weights.

How can I move them around to make a certain point on the drawing the
balance point (the centre of gravity)

i.e. :


2oz 4oz 12oz
6oz

3OZ

required balance point>>> x

5oz


Is it even possible with Visio 2002?
Alternatively, is there any software available?

As far as I can see there are an infinite number of solutions to this
problem.
However, ignore the weight units, as long as they are all the same
then the units don't matter.

if the required balance point is p(x,y)
for each of the weights w(x,y)
calculate the distance from the balance point
calculate the moment from the required balance point
calculate the angle for this weight
Combining these will give you the turning moment and angle with the
weights in their current position.
Th difficult bit is to determine which one(s) to move how far in which
direction to reduce the moment and angle both to 0.
 
Z

zulu

Sorry, see my 2nd post.
The weights are not all the sane.
I was hoping to be able to drag them (individually) in desired x or y axis
until balance point of the combined mass coincided with where I want it.
 
P

Paul Herber

Sorry, see my 2nd post.
The weights are not all the sane.

Yes, I realise that, it's the units of mass that are the same. for
what you want to do it matters not whther the units are ounces, grams,
or galactic masses.

I was hoping to be able to drag them (individually) in desired x or y axis
until balance point of the combined mass coincided with where I want it.

I'll have a look at something to do this later... I've got to go out.
 
Z

zulu

Paul Herber said:
Yes, I realise that, it's the units of mass that are the same. for
what you want to do it matters not whther the units are ounces, grams,
or galactic masses.

Sorry. I misunderstood.
I'll have a look at something to do this later... I've got to go out.

TYVM
Emjoy *out* :)
 
V

vojo

So are trying to keep a constant "center of gravity" here or just trying to
tie everything to a fixed poingt The former is going require moving
multiple shapes otherwise center point movies. The later is just a visio
thing.

per pauls comments....dont want to get into a dog fight but the issue is not
all the
cool math to figure out what do...the issue is how to implement in visio.
If you do some VBA...sure, lots of ways to do it. If you are trying with a
spreadsheet, I dont think its going to be quite that easy (if so, then it
would open up a whole new world of capabilities for visio that no posting I
have ever seen touched on...I would be very interested in that).
 
Z

zulu

As I said in another post....:

========================================

I want to move the shapes around individually, some in only X axis and
one in particular in only Y axis. I should have been more clear, sorry.
Let me try again....I'l use abc etc for the wights, and CG for the
(immovable) balance point.
<> = monable in X axis, Y = moveable in Y axis





Y




A(fixed, tied to CG)-------CG <B> <C> <D>

==============================================

Imagine 5 shapes:
A (say), is a longish rectangle, weight (say) 20g.
It's position constrains where the CG must be, which is just to the right of
the rectangle, (say 1cm).

B, C & D are on the same axis and weigh (say) 25g,, 6g & 26g respectively,
and are separately moveable along the x axis. (It might be sensible to find
the balance point of these 3 first, and then treat them as a single entity.

Given that these five items (drawn in Visio) are somewhere near where they
_should_ be, I need to identify where the balance point currently is so that
I can move one or more items to correct it.
 
W

Weeble

I have a Visio page with several randomly placed different shapes, all of
different (in the real world) weights.

How can I move them around to make a certain point on the drawing the
balance point (the centre of gravity)

As I understand from this post and others, what you would like is to
have the application calculate the centre of gravity of a number of
masses, and mark it. The mark should move as the shapes are re-
arranged.

I'm not sure if there's any way to solve the problem generally, such
that you can easily add as many masses as you want, at least without
using scripting. But if you're patient and don't have too many masses
to deal with, you should be able to set this up in Visio. I did it for
four masses in a fairly short space of time. Try this:

1) Create an object to use as a mass. I just drew a circle with the
ellipse tool.
2) Give it a custom property, with label "Mass" and name "Mass", which
must be a number.
3) For convenience, I then edited the text of the object and used
"Insert->Field...". Under "Custom Properties" I found my property
"Mass" listed, and selected it. I also edited the shape's protection
and checked the box for text, so that I couldn't accidentally change
the text. The shape now displays its mass as a number.
4) Next, I edited the shapesheet for my shape. I could see an entry
for "Prop.Mass" under "Custom Properties".
5) I right-clicked and chose "Insert Section...", and selected "User-
defined cells". A new section appeared with an entry called
"User.Row_1"
6) I renamed the entry to "WeightedX" and gave it a formula of
"=PinX*Prop.Mass"
7) I right-clicked on that entry and chose "Insert Row".
8) I renamed the new entry to "WeightedY" and gave it a formulat of
"=PinY*Prop.Mass"
9) Next I closed the shapesheet and copied my shape a few times.
10) I opened up the "Drawing Explorer" window and found my shapes.
They were called "Sheet.1", "Sheet.2", etc. I renamed them to "Body.
1", "Body.2", etc. so that I could tell them apart from other things I
created.
11) I created a new object, another circle. I made it a different
colour and renamed it "Centre".
12) I turned on protection for the shape's position.
13) I opened up the new shape's shapesheet.
14) I gave it this formula for PinX:

=(Body.1!User.WeightedX+
Body.2!User.WeightedX+
Body.3!User.WeightedX+
Body.4!User.WeightedX)/
(Body.1!Prop.Mass+
Body.2!Prop.Mass+
Body.3!Prop.Mass+
Body.4!Prop.Mass)

and this formula for PinY:

=(Body.1!User.WeightedY+
Body.2!User.WeightedY+
Body.3!User.WeightedY+
Body.4!User.WeightedY)/
(Body.1!Prop.Mass+
Body.2!Prop.Mass+
Body.3!Prop.Mass+
Body.4!Prop.Mass)

If I had made more shapes, I'd have needed to expand the formulae to
include them all.

Now you can drag the weights around and the centre of gravity follows
them. You can edit a shape's properties and change its mass, and its
effect on the centre of gravity changes. If you make a mistake and the
centre of gravity ends up disappearing off your page, you can still
select it in the Drawing Explorer. I hope it's close enough to what
you need to help! I've made a lot of assumptions (e.g. that you're
happy to treat the objects as point-masses), so it's possible it's not
quite what you wanted.
 
Z

zulu

Wow!!

Thank you _very_ much for all the effort you obviously put into your reply.
I've printed it out so that I can follow it step by step.

A lot of it is beyond my experiance, but believe ne I'll have a crack at
it.<g>
Treating the objects as points won't present a problm as I can work out
where in each object that point will be beforehand.

You are a star!
 
P

Paul Herber

Sorry. I misunderstood.

I see Weeble has already produced a solution, but you can have a look
at mine as well if you like, it's somewhet similar (but only for 2
shapes, adding more is simple).
The masses of the two squares can be changed via the shape custom
properties, when the squares are moved then the cross in the middle
will move to show the centre of mass.
 
Z

zulu

Paul Herber said:
I see Weeble has already produced a solution, but you can have a look
at mine as well if you like, it's somewhet similar (but only for 2
shapes, adding more is simple).
The masses of the two squares can be changed via the shape custom
properties, when the squares are moved then the cross in the middle
will move to show the centre of mass.


Wiil do Paul, and thanks :)

Once I can get the principle into my ageing brain I will be OK. <g>
 
V

vojo

oh...so you just wanted to find the center point of a bunch of shapes...not
keep the center point in a specific position and move shapes around to hold
that center point (ie maintain equalibrium)

note for every new shape, you want to update the center shape to include
(aka body.5!weightedx, body.5!prop.mas, etc etc etc)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top