Hey all,
I'm Lukas and I am new to scripting with Python and working in Vectorworks.
Basically I want to import a folder with 3dm files from Rhino into Vectorworks with each file on a new class.
My Script (copied from the internet) now looks like this but isn't finished yet (obviously).
import os
major, minor, maintenance, platform = vs.GetVersion()
isMac = False
if platform == 1: isMac = True
err, dirPath = vs.GetFolder( 'Select a Folder' )
if err == 0: # no-error
hsfDirPath = dirPath
if isMac: ok, hsfDirPath = vs.ConvertPosix2HSFPath( dirPath )
fileIndex = 1
while True: # loop the files
fileName = vs.GetFilesInFolder( hsfDirPath, fileIndex )
fileIndex += 1
if fileName == '': # no more files
break
name, ext = os.path.splitext( fileName )
if ext.lower() == '.3dm':
filePath = os.path.join( dirPath, fileName )
vs.BeginSym( name )
hFile = vs.ImportDXFDWG()
vs.EndSym()
vs.AlrtDialog( 'Done!' )
I was unable to find a dedicated function to import 3dm files. Is there a function like vs.ImportDXFDWG() but for 3dm files?
How do I implement in the loop the class creation with each class named like the file.
Thanks in advance to all.