If anyone is able to figure out why c:rpref doesn't work in the following example of code, I sure would appreciate it"Command:
(vl-load-com)
(defun rtod (a)
(/ (* a 180) pi)
)
;sets render preferences and file options
(defun C:setrender
()
(c:rpref "TOGGLE" "SKIPRDLG" "OFF")
(c:rpref "ROPT" "ASCAN" 2 NIL NIL 0 1 3)
(c:rfileopt "BMP" 640 480 1.0 "C8")
)
(defun c:ani (/ cntr deg entgrp fname num rotpnt)
; Turn command echoing off
(setq cmdold (getvar "cmdecho"))
(setvar "cmdecho" 0)
; Select the objects
(setq entgrp (ssget))
; Check to make sure you selected something
(if entgrp
(progn
; Set undo point
(command ".undo" "Mark")
; Pick rotation point
(setq rotpnt (getpoint "\nPick rotation point:<0,0,0> "))
(if (= rotpnt nil)
(setq rotpnt (list 0 0 0))
)
(setq num (getint "\nEnter number of images:<15> "))
(if (= num nil)
(setq num 15)
)
(setq deg
(rtod (getangle rotpnt "\nEnter degrees of movement:<3> "))
)
(if (= deg nil)
(setq deg 3)
)
(setq cntr 1)
(repeat num
; Add path here
(setq
fname (strcat
"D:\X\Y\Z\TestImage"
(itoa cntr)
".bmp"
)
)
(c:rpref "TOGGLE" "SKIPRDLG" "OFF")
(c:rpref "ROPT" "ASCAN" 2 NIL NIL 0 1 3)
(c:rfileopt "BMP" 640 480 1.0 "C8")
; ***renders an image to the specified filename***
(c:render (vl-princ-to-string fname))
; Rotate the object
(command ".rotate" entgrp "" rotpnt deg)
(setq cntr (1+ cntr))
) ; repeat
(command ".undo" "Back")
) ; progn
) ; if
; Return echo
(setvar "cmdecho" cmdold)
(princ)
)
Thx