Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

Hello and creating a script for importing AutoCAD files
show user profile  braisbr1
Hi all!

First of all, I'd like to introduce myself to the forum. I've been checking it from time to time since I've been using 3DSMAX for some years now, and I've found very useful topics every now and then. I've decided to join the forums now that I'm starting to delve deeper into the program itself, and Maxscript in particular. By the way, my name is Brais and I'm an architect from Spain.

The task that I have at hand at the moment is that I have multiple DWGs which I plan on converting to fbx, but only after I have selected specific layers from them and exported only those. To do so, I've created this script:

actionMan.executeAction 0 "40010" -- File: Import File
select $'Layer:Buildings'
actionMan.executeAction 0 "40373" -- File: Export Selected
select $'Layer:Terrain'
actionMan.executeAction 0 "40373" -- File: Export Selected

The thing is, it works for what I want, but I have to choose all the time what files I want to import and what files I want to export. Ideally, I'd like Max to open all the files from a folder that have a certain extension, like _dwgatzero.dwg at the end of each file, and export with a certain name that I set, without the need to go into pop up windows telling the program what to save and where to save.

I'm fairly new to MAXscript - completely new, in fact - and I'd love some advice to improve my script. Cheers to all and nice to meet you, hope to read you blogging often!



read 260 times
8/30/2016 1:01:34 PM (last edit: 8/30/2016 1:01:34 PM)
show user profile  khamski
Represent your probem visually in a clear way.
So it will be easier for coders here to undestand and get interested.

read 248 times
8/30/2016 1:38:16 PM (last edit: 8/30/2016 1:38:16 PM)
show user profile  braisbr1
All right!

Here's my code:

I'm using that to import files. The thing is, I would like to have the code in such a way that I already tell Max what files to pick. I'd like to do that as well for the exporting part, but I don;t know how.

read 245 times
8/30/2016 1:48:18 PM (last edit: 8/30/2016 1:48:18 PM)
#Maxforums IRC
Open chat window