Notifications
Clear all

[Closed] Script Import DWG "Legacy"

Hey Guys,

I am trying to complete a script in 3dsmax and I want to use the legacy import command for .dwg files.
The problem that I am having is all of my layers (ie. “siding”) are being imported in to max as (“Layer:siding”).
this happens because the default import command is newer and adds “Layer:” to the front of all layer names.
I am trying to find a way to use legacy import, when I manually import using legacy import the names come in the right way.
But there does not seem to be a way to assign the legacy import through scripting.

here is what I have :

theClasses = importerPlugin.classes

importfile “x:\IL_Jobs\models\Aberdeen-c.dwg” #noprompt theClasses[4]

Your help would be greatly appreciated.

Thanks

TS

2 Replies

The only way I found is to find the dwg import plugin and move it from it’s location. When doing that Max will take the legacy one as the default…

If only the naming is your issue then you can add a couple script lines at the end of your code to rename the objects imported. Something like this:

  
for o in objects where (matchpattern o.name pattern:"Layer:*") do o.name = (filterstring o.name ":")[2]


Thanks for your help Anton, I will give it a try.