AnsweredAssumed Answered

Propagating new custom property in mirrored parts via macro

Question asked by Matt Fisher on Jul 18, 2017
Latest reply on Jul 18, 2017 by Matt Fisher

I have a situation where a new custom property is being added to our part files. Any existing mirrored part is not propagating the new property. I have found that if you edit the first feature in a mirrored part and click the check mark with the custom properties checkbox checked then the new property will propagate without having to re-mirror.


The issue I'm having is that SolidWorks is crashing on swFeat.ModifyDefiniation. Any ideas?



                        Set swCompModelDoc = swComp.GetModelDoc2

                        If swComp.IsMirrored <> 0 Then

                            swComp.Select False



                            Set swFeat = swCompModelDoc.FirstFeature

                            Do Until swFeat Is Nothing

                                If swFeat.IsBase Then

                                    Set mirrorFeatData = swFeat.GetDefinition

                                    mirrorFeatData.AccessSelections swCompModelDoc, Nothing


                                    swFeat.ModifyDefinition mirrorFeatData, swCompModelDoc, Nothing

                                    Set mirrorFeatData = Nothing

                                    Exit Do

                                End If

                                Set swFeat = swFeat.GetNextFeature




                        End If