HELP!!! How to supplement LISP

Discussion of other Lisp dialects (Arc, Clojure, AutoLisp, XLISP, etc.)

HELP!!! How to supplement LISP

Postby kipianid » Thu Nov 11, 2010 4:14 am

[findinglisp: Moved to correct forum. Please categorize your posts. Autocad Lisp is not Common Lisp.

Dear all, i`m working very often with huge longitudinal section, and in general with all kind of sections.So, as long as is generated in Civil3D, all sort of labeling precisely aligned in section.But we editing all drawings with Autocad and as known this one can´t continiue the great job from Civil3D. Constant changes in the drawing, causes constant labeling changes and then, begins awful work. Thousand altitudinal and stations value must be aligned again.I was looking some tool or something, which could help me avoid constant measurement and labeling along the section.Finaly, i found one LISP which can do this job rapidly and precisely,but...

;Section Labeling
(defun c:sl (/ a b pkt x y z om)
(setq h 0.2 ;textheight EDITABLE!!!
fp 2 ;number of decimal places (integer!)
x1 2.4 ;gap VE - OK x Band
x2 3.6 ;gap VE - UK x Band
fx 1.0 ;faktor x value
y1 3.6 ;gap VE - OK y Band
y2 4.8 ;gap VE - OK y Band
fy 1.0 ;faktor y value
a 0.1 ;horizontal gap helpline-text
;VE 612.0 ;height reference datum
)
(setq pkt (getpoint "\nSelect Point: ")
VE (getreal "\nHeight of Reference: ")
)

(setq om (getvar 'osmode)
dz (getvar 'dimzin)
x (car pkt)
y (cadr pkt)
z (caddr pkt)
x1 (* x1 -1.0)
x2 (* x2 -1.0)
y1 (* y1 -1.0)
y2 (* y2 -1.0)
)
(setvar 'osmode 0)
(setvar 'dimzin 1)
(command "text" "p" "r" (list (+ x) (- x1 a) z) h 90 (rtos (* x fx) 2 fp))
(setq b1 (entlast))
(command "text" "p" "r" (list (+ x) (- y1 a) z) h 90 (rtos (+ VE (* y fy)) 2 fp))
(setq b2 (entlast))
(command "_line" (list x y z) (list x 0 z) "")
(setq b3 (entlast))
;(command "_line" (list x x1 z) (list x x2 z) "")
;(setq b4 (entlast))
;(command "_line" (list x y1 z) (list x y2 z) "")
;(setq b5 (entlast))
; (command "_copybase" (list x y z) b1 b2 b3 b4 b5 ""
; "_erase" b1 b2 b3 b4 b5 ""
; "_pasteblock" (list x y z)
; )
(setvar 'osmode om)
(setvar 'dimzin dz)
)

...so, works great, but there is one disadvantage, each time before you click on desired point, you need and must put UCS (ORIGIN) on right reference height and station! First UCS align, then start LISP, too many clicks!!! I´m sure there is a way to combine this two things in one LISP. I did try few things,but with my LISP knowledge, i could not manage this LISP. Please, maybe someone can help me supplement this LISP so that, when i start command "sl", that its asks first UCS(ORIGIN) insert point, than target point, and as last reference height.
Will be very thankful. Best David
kipianid
 
Posts: 2
Joined: Thu Nov 11, 2010 1:37 am

Return to Other Dialects

Who is online

Users browsing this forum: No registered users and 0 guests