Has anyone created a macro that can fix, as in not float, all parts in all subassembly's I have a step file with about 1000 parts and 50 subassembly's
steve
Has anyone created a macro that can fix, as in not float, all parts in all subassembly's I have a step file with about 1000 parts and 50 subassembly's
steve
You might start by searching the newsgroup. This has been discussed before.
I did but for some reason fix and fixing are very popular terms in this group :-)
steve
I have one that I use especially for imported models that goes through and fixes all parts. Email me and I will send it to you.
Or, you can go to
WT
*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account fromHi Wayne
Thanks for your help, but I must be doing something wrong, with the top level assy open I run the macro but nothing happens. I am a complete macro virgin, I keep meaning to give them a bit of time, but always seem to busy.
steve
Hmmm, I just tried it with SW2006, opened an assy, ran the macro, and all parts are now fixed. Do you get any error messages? What version of SW are you on?
WT
*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account fromTry this:
' ****************************************************************************** 'FixAll 'Devon T. Sowell, 3-D Design Solutions,Sub main() Set swApp = CreateObject("SldWorks.Application") Set AssyDoc = swApp.ActiveDoc ' Current document If (AssyDoc.GetType swDocASSEMBLY) Then Exit Sub ' Make sure this is an assembly
AssyName = AssyDoc.GetTitle 'Current Assy Name If InStr(1, AssyName, ".") Then AssyName = Left$(AssyName, InStr(1, AssyName, ".") - 1) 'Strip off .SLDASM if its there End If
' Find the Root Component Set Configuration = AssyDoc.GetActiveConfiguration() Set RootComponent = Configuration.GetRootComponent()
' Get list of children Component = RootComponent.GetChildren
ChildCount = UBound(Component) + 1 For i = 0 To (ChildCount - 1) ' For each Child in this subassembly Set Child = Component(i) ' Get Child component object retval = AssyDoc.SelectByID(Child.name2 & "@" & AssyName, "COMPONENT",
0, 0, 0) ' Select it AssyDoc.FixComponent ' Fix it Next i End Sub
Interesting - same code that I have.
WT
*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account fromHow does one search the newsgroup? I am using Outlook Express as the reader and can see that there are about 60000 mesages available that I have not read (including all the headers I have downloaded. Can one search the newsgroup without downloading all those headers?
TIA
bigbear
Thanks Frank That seems to work well!
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.