Notifications
Clear all

[Closed] MAXScript that can convert 3D coordinates to 2D points and lines

Hi!

I’ve created a 2d drawing into 3ds max with splines.
Then I’ve exported it in .dwg format.

The .dwg needs to be opened into Illustrator, and it works, but it isn’t correctly “orientated”, I mean that I see it like if it is in isometric view, and not in orto Top view.

I’ve asked on Adobe forum and they said it can’t be solved into Illustrator ’cause it is just a 2d application, they advice me to generate a 2d top view before to export the .dwg

Trying to export from top view doesn’t solve the problem.

I know I can export in .ai format, but not in this case, I have to use the .dwg

Adobe assistance said:
“I’m sure there is some line shader in there or some MAXScript that can convert 3D coordinates to 2D points and lines. Ask in a MAX forum.”

So I’m here to ask ’cause I don’t know what they means.

Thank you in advance.

4 Replies

Nah, it’s already in 2D, as you say, though if you’d open it for example in AutoCAD, you’d find the model space/paper space is set to this isometric view. If you have AutoCAD, DraftSight or a similar CAD application installed, you can switch it to top view there, resave and import again. Why do you have to use the .dwg here, anyway?

Thank you Sowrdslayer for the answer.
You’re right, if I switch to top view in autocad and re-save, it opens correctly in Illustrator.
But… there is always a “but”… bof… my client asked to me a 2d dwg version of each 3d model, and this is what I did, drawing and exporting from 3ds max, now he needs to open 2d .dwg in illustrator for some illustration creation, and the problem appears

If these .dwg would be few I could solve has you said, but they are a lot… and I have to find a way to do it automatically.

Ah yes, “simply” record a macro in autocad, but do you think that you can run the macro easily on multiple files? Noooo… could be too much easy… and an easy life is a boring life… better to do things complex and tricky, just to make life more interesting… bha… so I thought maybe in 3dsmax I can circumvent autocad… anyway…

sorry man, I thank you very very much for your support, without this forum I really don’t know how to solve and learn all the everydays problems.

Good job!

I think this could be solved with autolisp / script, too. It’s a long time since I’ve last played with lisp so for the sake of simplicity let’s go with the script commands, although I don’t have cad here to try I think something like _.open “c:\folder\file.dwg” _-view _top _.qsave _.close saved in a .scr file and run via _script command should work. As we are in maxscript forum, let’s create this file for a folder of .dwg files in maxscript:

(
	local printout = newScript()
	local folder = getSavePath caption:"Pick a folder"
	if doesFileExist folder do
	(
		local files = getFiles (pathConfig.appendPath folder "*.dwg")

		for file in files do
			format "_.open \"%\" _-view _top _.qsave _.close
" file to:printout
	)
)

Provided the original line works as expected, after running it (CTRL+E in maxscript editor) it should give you a file that you can save and run from autocad to batch process the files in folder (a word of warning, though, it overwrites the files, doesn’t create new versions).

very good.

Autoscript + your simple code works as it should.

On maxscript forum I can find also help for autocad script… simply the best… as tina turner said

Thank you man.

Good job.