Re: MAcro Help Please!

Aug 18, 2003 9 Replies

If you can show us what you have so far, we can help.



Best Regards,



Would it be possible to use a screen capture program such as SnagIt

formatting link
so, you could just move the assembly in real time and the AVI would be done.

JJ

HI Robert,

This is what I have so far.

****************************** Dim swApp As Object Dim Part As Object Dim RotateStep As Integer

Sub main()

Dim DocPath As String

Set swApp = CreateObject("SldWorks.Application") Set Part = swApp.ActiveDoc TotalPath = Part.GetPathName SlashPosition = InStrRev(TotalPath, "\", , 1) DocPath = Left(Part.GetPathName, SlashPosition - 1)

Message = "JPEG's will be saved in Current Document Folder: " & DocPath Icon = swMbInformation Buttons = swMbOkCancel Title = "Capture JPEG" ' Set title. Result = swApp.SendMsgToUser2(Message, Icon, Buttons)

For RotateStep = 1 To 3 Part.ModelDoc2.Rebuild (swUpdateMates)

Part.ShowNamedView2 "*Isometric", 7 Part.ViewZoomtofit2 Part.SaveAs2 DocPath & "\iso-"RotateStep".JPG", 0, True, False

RotateStep = RotateStep + 1 Next RotateStep

End Sub

***********************************

Hello Philippe,

Darn!!! I saw your website on friday when i started thinking about this, but I didn't see the link to the macro.

DUH!!! BTW, I thought that I would use JASC's Animation Shop or something.

Thank You, Muggs

Thanks JJ,

Yes, I have SnagIt, and I love it, and for that it's perfect. But, I'm want is to show only part of an assembly rotating about an axis, imagine a fan blade rotating inside of a fan assembly, and you'll have a pretty good idea of what I want.

Thanks again, Muggs

what if you put that in an assembly and added the simulation/rotary motion to it and played while using SnagIt ofcourse this would only work from 2003 and up.

be

Thanks Corey,

Yea, I'm not giving you all the info, I'm using 2001Plus, sorry.

Muggs

If you are looking to rotate in a certain direction after setting to isometric view, you can't include the Part.ShowNamedView2 "*Isometric", 7 line in the For loop. Please take a look at ModelDoc::ViewRotateplusx after setting the standard increment setting to 5 deg., you can use this function or others like it to rotate the part.

HTH,

The line Part.SaveAs2 DocPath & "\iso-"RotateStep".JPG", 0, True, False

should read Part.SaveAs2 DocPath & "\iso-" & RotateStep & ".JPG", 0, True, False ('&' added two places)

-- Tony O'Hara Melbourne, Australia.

If you only want to rotate a "fan" and not pan around the rest of the assembly then you only need enough frames to rotate the fan one blade position. ie, 6 blades to appear to spin 360deg, just rotate fand thru 59 deg (or it will repeat the first frame), then in you animation program just loop the sequence. Unless of course you have different coloured blades.

Yes, I have SnagIt, and I love it, and for that it's perfect. But, I'm want is to show only part of an assembly rotating about an axis, imagine a fan blade rotating inside of a fan assembly, and you'll have a pretty good idea of what I want.

Thanks again, Muggs

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required