Thursday, October 18, 2012

SketchUp Animation - "Spiral Staircase"

One great feature of SketchUp is how fly-through or fly-over or fly-by animation could be produced on the fly. And coupled with "section plane" function one has no problem producing cool construction sequence at all.

It's been a while since I last made any animation with SketchUp. I used the spiral staircase model I made, which I also shared on that page, throw in a few sections and scenes and here's the result:


This is not a real construction or assembly sequence by all means, I made this to brush up my rusty "section-planing" skill.

Like usual, the scenes are exported as 4000x2250pix PNGs and assembled in VirtualDub and encoded using x264 codec. VirtualDub can be found here, and x264vfw here.

Sunday, October 14, 2012

Simple AutoLISP Code: Flip Dimension Text

This is a command I called D180, which function is rotating a dimension text by 180 degree.

(defun errD180 (msg)
(command)
(setq *error* localErrorD180)
(prompt "\nError. Program cancelled. ")
(princ)
)
(defun C:D180 (/ localErrorD180 dimProperty dimTxtRotationOld dimTxtRotationNew dimTxtRotationUpdate)
(setq localErrorD180 *error*)
(setq *error* errD180)
(setq dimProperty (entget (car (entsel "\nSelect dimension: "))))
(setq dimTxtRotationOld (cdr (assoc 51 dimProperty)))
(setq dimTxtRotationNew (+ dimTxtRotationOld (deg2rad 180)))
(setq dimTxtRotationUpdate (subst (cons 51 dimTxtRotationNew) (assoc 51 dimProperty) dimProperty))
(entmod dimTxtRotationUpdate)
(setq *error* localErrorD180)
(princ)
)
(defun deg2rad (d)
(* pi (/ d 180.0))
)

I must admit the codes are rather clumpy and crude. I've seen the same purpose achieved by lesser lines and much elegant codes, but that's beyond my programming skill. :-)
Related Posts Plugin for WordPress, Blogger...