I try to make a macro to facilitate a task that we often do to demine the size of the standard parts we create.
These are the steps to follow, I send you below the description of these tasks for a better understanding:
1) Open the SOLIDWORKS file 2) Open the room family in a new window 3) Save the excel file 4) Close the Excel file 5) Delete the Part Family in SOLIDWORKS 6) Delete Configurations 7) Uncheck the option "link display states to config" 8) Save the SOLIDWORKS file 9) Recreate the part family (insert\tables\Part family) 10) Check the "From File" option and tell it the Excel file you previously saved. 11) Redo Publisher 12) Save the file.
No problem is launched during the recording, until the exusion where the macro freezes at the level of closing the Excel file, (image below)
anyone have any idea how I can solve this problem, I would be very grateful if you could help me:)
PL, I tried deleting all the lines that contain the closure of the file but it doesn't work it blocks in the following line,
By the way I just noticed something in the macro file, it's that I have to make a file for each component (nut, screws ...) because in the step where you have to select and delete the configs there is a description of the name of the config (e.g. medium cs washer M 12 .. ) , I tried to delete the description (example: boolstatus = Part.Extension.SelectByID2("Convex washer C M30 CL4 (SP01033520A)", "CONFIGURATIONS", 0, 0, 0, True, 0, Nothing, 0)
and replace it with: boolstatus = Part.Extension.SelectByID2 )
Do you know VBA programming for SolidWorks or VBA for short?
Because there is a lot of work! Indeed, you can't just save this type of macro to use it on all files (as for the name of the configurations), you have to loop on all the configurations.
See my tutorials that loop on all the configurations for inspiration: