Stl to Solidworks conversion batch

Hi all

I'm asking my first question here because I have an import problem under SolidWorks 2021...
I have a list of files in STL format that I want to use in SW.
Manually this is done in problem via the stl import options, or in " Imported geometry" so that each imported file is imported as a volume.

The problem is that I have more than 80000 files to convert and this must be done via a macro if I want to finish the operation before my retirement...
Despite all my attempts at coding, I can't force the volume import. It opens the first file correctly, but the second one defaults back to mesh...

Not being a pro of macro under SW I certainly missed a few things so I'm trying my luck here...
(Knowing that I have already tried the MyCadTool BatchConverter which gives the same result...)

Thank you very much!

STL.zip (16.9 KB)
STLtoSW.swp (40 KB)

Hello

No problem on the 2023 with this code. Maybe a bug in the 2021

1 Like