Design Table VBA Controls

Hi all!

 

I've made a lot of progress since then regarding the small simulation and the update of the parts families in the car!

 

But I'm coming to a problem about the "insertfamilytableopen" function

 

I'll quickly explain the manipulation that my code is doing at the moment:

 

It reads the assembly piece by part, counts the files (assemblies and parts) that have a part family.

 

Ask the user for permission to then extract these tables into a .xls file, delete the active table (internal to solidworks) and then link a new table to the excel file (apart from the location of the part family, the dimensions do not change for the moment)

 

Once this is done, the user must enter the address of the folder containing all the .xls files before they are updated according to the base file.

 

Then an update of the assembly is made.

 

Good... In theory, it works! The problem is that even this done, the part family in solidworks doesn't change an inch actually! =o

 

Would there be a way to link this "insertfamilytableopen" function to a specific part of the assembly? and to check that it is well connected?

 

because I must admit that I don't really see where the problem comes from =/

 

Friendly

Yoann

 

(I can link the excel file containing the complete code if necessary)

For those who would be interested, here is the little bit that solved my problem:

 

 "Dim swModel         As SldWorks.ModelDoc2

 Dim swDesignTable   As SldWorks.DesignTable

 Dim Longstatus   As Long

 Dim Longwarnings As Long

 

Set swApp = CreateObject("SldWorks.Application")

 

 

filename = "c:\users\" & UserName & "\desktop\Simu\00-" & NumP & "-0-Came.xls"
       
        
        Set swModel = swApp.OpenDoc6("C:\PDM\11 SIMULATION\01 Continuous Casemaker\Introduction_ _produit\00-XXXXX-0-Came.SLDPRT", 1, 0, "", longstatus, longwarnings)

       
        swModel.DeleteDesignTable
        
        swModel.InsertFamilyTableOpen (filename)
        swModel.CloseFamilyTable
        
        Set DesignTable = swModel.GetDesignTable
        
        DesignTable.LinkToFile = True
        
      
       swModel.Save"

 

That's it =) After one  struggle after another, I'm finally reaching my goal! Partial automation of a format changeover on Solidworks :-)

 

Hoping it can help

 

Friendly

 

Yoann