Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2010, 09:15 AM
PBone PBone is offline Motion Paths with Rotation Windows XP Motion Paths with Rotation Office 2007
Novice
Motion Paths with Rotation
 
Join Date: Dec 2010
Posts: 2
PBone is on a distinguished road
Question Motion Paths with Rotation

I am putting together a PPT where I require an object to have motion paths. The object is to move round a circle. Is it possible to rotate the object along with a motion path? The motion path bit is quite easy - it's the rotation bit that would be quite useful. Thanks
Reply With Quote
  #2  
Old 12-17-2010, 10:05 AM
jsmath22 jsmath22 is offline Motion Paths with Rotation Windows XP Motion Paths with Rotation Office 2007
Novice
 
Join Date: Nov 2010
Posts: 14
jsmath22 is on a distinguished road
Default You have to use macros

Hello,
The only way I know of how to get the rotation to be an animaiton is using a macro. Here is a bit of code that will rotate an object 360 degrees and the DoEvents line will make PowerPoint reposition the shape each time so it looks like an animation. Hopefully you are working with 2007.

Public Sub CircleRotate()
Dim sld As Slide
Dim dude As Shape
Dim n As Integer


Set sld = ActivePresentation.Slides(1) 'slide number visual is on
Set dude = sld.Shapes("Picture 2") 'name found by using Selection Pane

n = 20
For i = 1 To n
If i < 10 Then
dude.Top = dude.Top + 1
dude.Left = dude.Left + 1
Else
dude.Top = dude.Top - 1
dude.Left = dude.Left - 1
End If
dude.Rotation = dude.Rotation + (360 / n)
DoEvents
Next i
End Sub

This will move the dude object in a line, for a circle you have to use four quandrants, so some adjustments will be needed.

Then to execute the code, you can assign an action to the shape you are trying to move. Once you have written the macro, click on the shape, go to the Insert tab and you should see "Action" under the Links menu. Click on that and the Action Settings menu box will come up. Click on the Run a Macro option button and choose the macro name from the drop down.

Hope this helps!!

Signed,
Math Nerd
Reply With Quote
  #3  
Old 12-21-2010, 11:36 AM
jsmath22 jsmath22 is offline Motion Paths with Rotation Windows XP Motion Paths with Rotation Office 2007
Novice
 
Join Date: Nov 2010
Posts: 14
jsmath22 is on a distinguished road
Red face got it with a circle!

OK, so I figured out how to make it work in a circle instead of just a line. You have to specify the size of the circle that you want to rotate the object around. In my macro, I have the circle on the slide, so I just name it.

OK, here it is:

Sub finalmove()
Dim sld As Slide
Dim wheel As Shape
Dim aro As Shape
Dim n As Integer
Dim pi As Double, angl As Double

pi = 3.14159265358979
Set sld = ActivePresentation.Slides(5) 'slide objects are on
Set wheel = sld.Shapes("Group 8") 'the circle of rotation
whcenx = wheel.Left + wheel.Width / 2 'the center of the circle
whceny = wheel.Top + wheel.Height / 2
rad = wheel.Width / 2 'radius of the circle
Set aro = sld.Shapes("Left Arrow 10") ' object being rotated/circulated
n = 52 'number of moves/spokes
angl = 2 * pi / n
For i = 1 To n
aro.Left = whcenx - (rad * Sin(angl * i)) - aro.Width / 2
aro.Top = whceny + (rad * Cos(angl * i)) - aro.Height / 2
aro.Rotation = aro.Rotation + (360 / n)
DoEvents
Next i
End Sub


Let me know if this works, hopefully it is not too late.

Math Nerd

Last edited by jsmath22; 12-22-2010 at 04:47 AM.
Reply With Quote
  #4  
Old 01-10-2011, 07:17 AM
PBone PBone is offline Motion Paths with Rotation Windows XP Motion Paths with Rotation Office 2007
Novice
Motion Paths with Rotation
 
Join Date: Dec 2010
Posts: 2
PBone is on a distinguished road
Default Response to Math Nerd

Hi
Sorry for not responding earlier - been off work becoming a daddy

Will give the code a shot and let you know - thanks for the assistance
Reply With Quote
  #5  
Old 01-13-2011, 11:59 AM
jsmath22 jsmath22 is offline Motion Paths with Rotation Windows XP Motion Paths with Rotation Office 2007
Novice
 
Join Date: Nov 2010
Posts: 14
jsmath22 is on a distinguished road
Default

Congratulations! If it doesn't work, let me know and I can try to fix it. If it does, could you mark the post solved? I am trying to advance from the "Novice" and I think a factor may be how many issues you solve.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolution problems with growing and image along a motion path inf327 PowerPoint 4 10-27-2010 05:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft