Results 1 to 4 of 4

Thread: Elevation Retrive? Using AutoLisp Function

  1. #1
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Elevation Retrive? Using AutoLisp Function

    How to retrive elevation Value(Property) of 3dPoly/2Dpoly/Poly using Lisp function using single entity Pick?



  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Elevation Retrive? Using AutoLisp Function

    Hope this work for you buddy ..

    Code:
    (defun c:TesT (/ ss e lst)
      (vl-load-com)
      ;; Tharwat 01 Nov. 2011 ;;
      (if (and (setq ss (car (entsel "\n select a Polyline :")))
               (member (cdr (assoc 0 (setq e (entget ss))))
                       '("POLYLINE" "LWPOLYLINE")
               )
          )
        (progn
          (setq lst (vl-remove-if-not
                      (function (lambda (x)
                                  (eq (car x) 100)
                                )
                      )
                      e
                    )
          )
          (if (not (member '(100 . "AcDb3dPolyline") lst))
            (princ
              (strcat
                "\n "
                "The Elevation is : "
                (rtos (vla-get-elevation (vlax-ename->vla-object ss)) 2)
              )
            )
          )
        )
        (princ)
      )
      (princ)
    )
    Tharwat

  3. #3
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Elevation Retrive? Using AutoLisp Function

    A 3dpolyline can have multiple elevations (different at each vertex). In that situation, are you wanting the closest vertex elevation to where you select the polyline?

  4. #4
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Re: Elevation Retrive? Using AutoLisp Function

    Thanks for Reply.............it is true that every vertex might carry different Elevation Value. But in my case All Vertex Carry same Elevation Value.

    As i am using AutoCAD map 2004. Using Clean up option i convert 3Dpoly to Simple Polyline. And Best result i found is that Elevation remains same it is not set "0". So i write Simple Lisp that works Perfect.




    (defun c:ee()
    (while(setq aa(car(entsel"pIck Entity ...")))
    (setq bb(entget aa))
    (setq cc (cdr(Assoc 38 bb)))
    (setq rt (rtos cc 2 3))
    (setq msg (strcat"\nCurrent Elevation Height is:" rt))
    (prompt msg)
    (setvar "OSMode" 204
    (setq ww 200)
    (setq aa (- cc ww))
    (command "Pline" (getpoint) "Length" aa "" "")
    )
    )




    Quote Originally Posted by alanjt View Post
    A 3dpolyline can have multiple elevations (different at each vertex). In that situation, are you wanting the closest vertex elevation to where you select the polyline?

Similar Threads

  1. Replies: 3
    Last Post: 2014-08-05, 08:51 PM
  2. Autolisp function to determine point location
    By BrenBren in forum API Wish List
    Replies: 2
    Last Post: 2010-09-28, 03:45 PM
  3. Autolisp Function to Determine Point Location
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2008-05-21, 10:50 AM
  4. AutoLISP function to change DB's values
    By truevis in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2007-11-19, 05:31 AM
  5. AutoLISP function to get values of existing dynamic block insert
    By truevis in forum Dynamic Blocks - Technical
    Replies: 0
    Last Post: 2007-11-17, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •