I don't have .step files to test the code. IF the extensions of your file is .stp you have to modify the code(replace .step with .stp).
The script allows you to select folder where step files are located. You can't select step files separately.
(
function GetFilesRecursive root pattern =
(
dir_array = GetDirectories (root+"\*")
for d in dir_array do
join dir_array (GetDirectories (d+"*"))
my_files = #()
for f in dir_array do
join my_files (getFiles (f + pattern))
my_files
)
dir = getSavePath caption:"Select the directory" initialDir:"$scenes"
if dir != undefined do
(
filesArr = #()
filesArr = getFiles (dir+"\*" + ".step")
subFiles = GetFilesRecursive dir ("*" + ".step")
if subFiles.count != 0 then
(
msg = "The selected folder has subfolders!\n"
msg += "Do you want to include the files from the subfolders too?"
if queryBox msg title:"Sub-folders found" do
join filesArr subFiles
)
if filesArr.count != 0 do
(
for f in filesArr do
(
importFile f #noPrompt
)
)
)
)
https://miauu-maxscript.com/