AnsweredAssumed Answered

Accessing part features through PDMWorgroup

Question asked by Louise Cléroux on Jun 8, 2018
Latest reply on Jun 8, 2018 by Artem Taturevych

I wrote a macro that will determine if a sheet metal part has bends (with the help of many on this forum). I can use this macro on any part file already open in SolidWorks and it works great.

 

My next step it to do the same through the PDMWorkgroup 2017 wihout opening any parts in SolidWorks. I have the code written to scan particular projects in PDMWorkgroup and get the list of the parts but I have type mismatch that I need help resolving.

 

For the PDMWorgroup scan, I have:

               Dim PartFile as PDMWDocument

 

But for the Bend part of the code, I need:

                Dim swModel As SldWorks.ModelDoc2

Because I utlimately need:

               Dim swFeat As SldWorks.Feature

               Dim swSubFeat As SldWorks.Feature

To get to

               If swSubFeat.GetTypeName2 = "UiBend" Then

                    FoundBend = True

               End If

 

 

How do I get from PartFile to swModel? Is it possible without extracting/opening every PartFile?

 

Thanks everyone.

Outcomes