|
I’ve written a small script to import a dwg file and render it to a png file.
I renders fine except there is too much surrounding white space in the png file.
I thought “max zoomext sel all” would fix it but it doesn’t.
Any suggestions?
Code below, image attached.
-- reset the scene, show no dialogs
resetMaxFile #noPrompt
-- load the scene file
loadMaxFile “C:\\Temp\\Symbols\\Scenes\\dwg2png2012.max”
-- import the file, show no dialogs
importFile “C:\\Users\\jprisbe\\AppData\\Local\\Temp\\STCPlotToPNG\\TXRA31.DWG” #noPrompt
-- select block
max select all
-- get selected block
selset = getCurrentSelection()
-- set the viewport to iso
viewport.setType #view_iso_user
-- apply material to selected object(s)
-- using default material passed to function
myMaterial = meditMaterials[2]
-- apply selected material to all objects selected
for obj in selset do obj.material = myMaterial
-- zoom entents
max zoomext sel all
render renderType:#blowup outputwidth:240 outputheight:240 force2sided:true outputfile:"c:\\temp\\symbols\\240x240\\test.png" vfb:false
| Attachment
|
|
|
|
|