Jump to content

Recommended Posts

Posted

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.

Posted (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 by woodman78
Highlighted changes to code
Posted

Because the text is just that you could check pt1 pt2 angle and move text as an extra step at end.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...