Hello everyone.
Happy new year .
So, my problem goes like this:
We've been using a lisp routine to draw pipes since 2010, and it has been very useful mainly to extract quantities (with the "ExtAttr.xls" file that comes with Autocad). However, we want to update to Autocad 2014, and the routine doesn´t work in it.
I think I managed to trace back the problem to a "tracewid" variable, that became obsolete in Autocad 2012. The thing is, I don't really know that much lisp, so I'm not really sure how to fix it, or even if it should be fixed in the first place - maybe I could try to write a routine from scratch, that lets me draw pipes and extract its quantities, but currently I don´t even know where to start .
Any help or insight you can give me is extremely appreciated.
This is the routine:
Code:
;TUBOS STANDARD
(defun C:tubo ()
(SETVAR "cmdecho" 0)
(setq sx 0.0)
(setq os (getvar "osmode"))
(setvar "osmode" 247)
(setq pi (getpoint "\nPunto de Inicio : "))
(setq pf (getpoint "\nPunto final : " pi))
(setvar "osmode" 0)
(setq ang1 (/ (angle pi pf) 0.0174533))
(setq ang2 (/ (angle pf pi) 0.0174533))
(setq pi1 (car pi))
(setq pi2 (cadr pi))
(setq sx (distance pi pf))
(setq sxd (rtos sx 2 2))
(setq sy (getvar "tracewid"))
(setq dt (/ (distance pi pf) 2))
(setq p1t (polar pi ang1 dt))
(command "insert" "tb" (list pi1 pi2) sx sy ang1 mat sxd)
(setvar "osmode" os)
)
This is an example of the script we use to draw the pipes:
Code:
^c^csetvar tracewid 0.083 (setq mat "PVC-S TUB. 3") (setq dia 3) tubo
I also attached the block file needed for the routine (although, I'm not sure how it works. If anyone would care to explain, i'd be very grateful)
Thanks for your time.