Macro for Unsuppress all mates in all assemblies

Is there a macro out there that can toggle all the mates active in an assembly in all the configs, or just unsupress all the mates in an assembly?

I realize this is most likely going to bite me in the butt but I want to give it a go and try and save some time


Reply to
Ben Eadie
Loading thread data ...

This will unsuppress all the mates in an assembly. I'm not really sure, but I'd guess it only affects the active configuration. Ken

'Copied from/Started with: 'Get Mates and Mate Entities Example (VB) 'This example shows how to traverse a FeatureManager design tree and get all of the assemblies mates and mate entities.

'---------------------------------------------- ' Preconditions: Assembly document is open. ' Postconditioins: None '

Option Explicit

Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swFeat As SldWorks.feature Dim swMateFeat As SldWorks.feature Dim swSubFeat As SldWorks.feature Dim swMate As SldWorks.Mate2 Dim swComp As SldWorks.Component2 Dim swMateEnt(2) As SldWorks.MateEntity2 Dim i As Integer

' Disable Visual Basic error on implicit Query Interface On Error Resume Next

Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swFeat = swModel.FirstFeature

' Iterate over features in FeatureManager design tree Do While Not swFeat Is Nothing If "MateGroup" = swFeat.GetTypeName Then Set swMateFeat = swFeat ' Get first mate, which is a subfeature Set swSubFeat = swMateFeat.GetFirstSubFeature Do While Not swSubFeat Is Nothing Set swMate = swSubFeat.GetSpecificFeature2

If Not swMate Is Nothing Then ' Debug.Print swSubFeat.Name swModel.SelectByID swSubFeat.Name, "MATE", 0, 0, 0 swModel.SelectedFeatureProperties 0, 0, 0, 0, 0,

0, 0, 1, 0, swSubFeat.Name swModel.ClearSelection End If

' Get the next mate in MateGroup Set swSubFeat = swSubFeat.GetNextSubFeature Loop End If Set swFeat = swFeat.GetNextFeature Loop End Sub

Reply to
Tin Man

If this is just the top level why not just shift select the mates and under the edit pull down choose unsuppress-all configurations?


Reply to

Why not... Ill tell you why not... Ummmm I errrrrr welll you see its like this i was too busy to see the obvious? Will that do?


Reply to
Ben Eadie

Random behavior macro? More descriptive: 'Postconditions: all mates in active assembly unsuppressed.'

Reply to

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.