Jump to content

oldluke

Member
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Location
    Germany
  1. Hey Raymond, Thx for your reply. That sort of works, but when I have a lot of 3DM files (maybe about 100) I don't want to select every one by hand in the open file dialog. Is there a way to automate this, so I have to just choose the folder (like vs.GetFolder) and every file is imported to a new class? Kind Regards Lukas
  2. 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.
×
×
  • Create New...