Changing views with AutoLISP

Changing views with AutoLISP

amacklinZE25K
Explorer Explorer
608 Views
4 Replies
Message 1 of 5

Changing views with AutoLISP

amacklinZE25K
Explorer
Explorer

Hi so I'm an architecture intern and I have a pet project in 3d that I'm working on. I want to automate the rendering process of it. What I want to do is switch between all of my different views that I have setup via the cameras, and then render them out. I have a pretty beginner knowledge of AutoLISP

0 Likes
Accepted solutions (1)
609 Views
4 Replies
Replies (4)
Message 2 of 5

paullimapa
Mentor
Mentor

Not sure if code from this thread still works since it was designed for a much older version of AutoCAD but you can give it a try


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 5

amacklinZE25K
Explorer
Explorer

Thanks

0 Likes
Message 4 of 5

paullimapa
Mentor
Mentor

You are welcome…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 5

amacklinZE25K
Explorer
Explorer
Accepted solution

This was my code just in case anyone else wants it

(defun c:bulkRend (/ viewNames renderPath renderFileName delay)
  ;; List of view names you want to render
  (setq viewNames '("view1" "view2" "view3"))
  
  ;; Loop through each view name and render
  (foreach viewName viewNames
    ;; Set the current view to the named view
    (setq renderPath (strcat "C:\\path\\" viewName ".png"))
    (command "._VIEW" "_r" viewName)
    
    ;; Start rendering pretty low quality
    (command "RENDER" "LOW" "RENDER" "800" "600" "Y" renderPath)
    
    ;; Delay between renders so my pc fans don't spin up to 100% you can remove
    (command "'delay" "5000")
  )
  
  (princ) ;; Exit quietly
)