woodman78 Posted March 11, 2014 Posted March 11, 2014 Hi all, Long time no write.... I am trying to use this lisp: http://www.cadlispandtips.com/2011/10/lisp-elevation-marker.html but when I follow the instructions I get the block coming into the drawing with an elevation of 0. Am I missing something? I loaded the 2 lisp files and ran EDAT and chose the location to set the datum and then ran the ELE command but the block has 0 for an elevation. Would appreciate any help.. Thanks. Quote
woodman78 Posted March 11, 2014 Author Posted March 11, 2014 (edited) So I went back to LeeMac's routine and modified it slightly to display the elevation as we do in our office: ;;-----------------------=={ Elevation Marker }==-----------------------;; ;; ;; ;; This program continuously prompts the user to specify a point and ;; ;; constructs an elevation marker composed of a variable width ;; ;; polyline & single-line text object at the specified point, with ;; ;; the text content displaying the UCS Y-coordinate of the point. ;; ;; ;; ;;----------------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;; ;;----------------------------------------------------------------------;; (defun c:em ( / *error* ang hgt len ocs pt1 pt2 pt3 pt4 str ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (setq hgt (getvar 'textsize) ocs (trans '(0.0 0.0 1.0) 1 0 t) ang (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t)) ) (terpri) (while (setq pt1 (getpoint "\rSpecify point <exit>: ")) (setq str (rtos (cadr pt1)) len (strlen str) pt2 (list (car pt1) (+ (cadr pt1) (* hgt 0.5 (sqrt 3)))) pt3 (list (- (car pt1) (* hgt len)) (cadr pt2)) pt4 (list (- (car pt2) (* hgt 0.5 len)) (+ (cadr pt2) hgt)) ) (foreach sym '(pt1 pt2 pt3 pt4) (set sym (trans (eval sym) 1 ocs)) ) (entmake (list '(000 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(090 . 3) '(070 . 0) (cons 038 (caddr pt1)) (cons 010 pt1) '(040 . 0.0) (cons 041 hgt) (cons 010 pt2) [color="red"] (cons 040 (* hgt 0.01)) (cons 041 (* hgt 0.01))[/color] [color="red"] ;(cons 010 pt3) ;(cons 210 ocs)[/color] ) ) (entmake (list '(000 . "TEXT") (cons 007 (getvar 'textstyle)) (cons 001 str) (cons 050 ang) (cons 040 hgt) [color="red"] (cons 010 pt3) ; turns text on and off[/color] (cons 011 pt4) [color="red"] '(072 . 0)[/color] '(073 . 2) (cons 210 ocs) ) ) ) (princ) ) One thing I need and would like if someone could help with is the possbility to change whether the elevation appears above a line with the arrow pointing down and below the line with the arrow pointing up. It's just that we detail a lot of walls and it is very handy sometimes to have the elevation under the wall capping etc.. Thanks. Edited March 11, 2014 by woodman78 Highlighted changes to code Quote
BIGAL Posted March 12, 2014 Posted March 12, 2014 Because the text is just that you could check pt1 pt2 angle and move text as an extra step at end. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.