Hello all,
I am trying to use a block with attributes to size dyuct work in AMEP 09.
I would like to use the autosizing feature but this is not (yet) company standard.
I would like to know how to select a duct and obtain its width and height so that I may use it in a routine.
If anyone could help fill in my holes or have better suggestions, I certainly would appreciate it.
Thanks in advance,
Andre
Code:
defun c:test (/ bname selduct ductw ducth sp1 attval)
(setq bname "XXX")
(setq selduct (select duct))
(setq ductw (get selduct's width))
(setq ducth (get selduct's height))
(setq attval1 (strcat (rtos ductw 2 0) "x"(rtos ducth 2 0)))
(command "insert" "bname" "s" 1 "r" 0 pause)
(command attval1)
(setq sp1 (getvar "lastpoint"))
(command "rotate" (entlast) "" sp1 pause)
(princ))