+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Sep 2012
    Posts
    80

    Default I want lisp to get label at the polyline starting edge and ending edge

    Registered forum members do not see this ad.

    I want lisp to get at the beginning and end of each polyline of the Elevation Label
    Attached Images
    Attached Files

  2. #2
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,718

    Default

    I moved your thread to the AutoLISP, Visual LISP & DCL Forum.

    Please post in the appropriate forum most closely related to your question.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  3. #3
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,716

    Default

    A start for you maybe have a go at writing a lisp using vl you can get co-ords of plines and their elevation

    [code]
    (vl-load-com)
    (setq obj1 (vlax-ename->vla-object (car (entsel "\npick pline"))))
    (setq coords (vlax-safearray->list (vlax-variant-value(vla-get-coordinates obj1)))) ; 1st 2 variables are start last 2 are end pt
    (setq ht (vla-get-elevation obj1)) ; height of pline
    [code]
    A man who never made mistakes never made anything

  4. #4
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Sep 2012
    Posts
    80

    Default

    i have got it already lisp file but in this lisp file little be mistake. this file was generate only start edge. i need generated with Polyline both of side edge.

    (defun C:MCL ()
    (setq ss (ssget'((0 . "LWPOLYLINE"))))
    (setq sslngth (sslength ss))
    (Setq idx 0)
    (repeat sslngth
    (setq ename (ssname ss (setq sslngth (1- sslngth))))
    (setq edata (entget ename))
    (setq xy (cdr (Assoc 38 edata)))
    (setq xy1(cdr (Assoc 10 edata)))
    (setq xx(rtos xy 2 3))
    (command "text" xy1 2 30 xx "")
    )
    )

  5. #5
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    555

    Default

    Quote Originally Posted by sanju2323 View Post
    i have got it already lisp file but in this lisp file little be mistake. this file was generate only start edge. i need generated with Polyline both of side edge.
    Try..
    Code:
    (defun c:test (/ ss i ed p sz)
    (initget 6)
    (if (not(setq sz (getdist "\nText size : ")))
    (setq sz (getvar "textsize")))
      (prompt "\nSelect Contour.. ")
      (if (setq ss (ssget ":L" '((0 . "LWPOLYLINE"))))
        (repeat (setq i (sslength ss))
          (setq ed (entget (ssname ss (setq i (1- i)))))
          (foreach x (list (car (setq p (vl-remove-if ''((x) (/= (car x) 10)) ed))) (last p))
    	(entmakex (list	'(0 . "TEXT")'(8 . "CONTOUR LABEL")
    			(cons 1 (rtos (cdr (assoc 38 ed)) 2 3))
    			(cons 40 sz)
    			x
    			) ;_ end of list
    		  ) ;_ end of entmakex
    	) ;_ end of foreach
          ) ;_ end of repeat
        ) ;_ end of if
      (princ)
      ) ;_ end of defun
    i hope BIGAL can understand im online now to help OP
    Last edited by hanhphuc; 11th Dec 2014 at 10:58 am. Reason: textsize
    lambda not optimized.. ( apply '= "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

  6. #6
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Sep 2012
    Posts
    80

    Default

    Thank You Sir Its Work

  7. #7
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    555

    Default

    you are welcome, please read this regarding code Tag for newbie
    http://www.cadtutor.net/forum/showth...ing-guidelines
    lambda not optimized.. ( apply '= "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

  8. #8
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Sep 2012
    Posts
    80

    Default

    can you make changes in LISP. For example set text height, "2" and select polyline or spline

  9. #9
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    555

    Default

    #5 updated (in red)

    you can set default,
    command: textsize
    lambda not optimized.. ( apply '= "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

  10. #10
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Sep 2012
    Posts
    80

    Default

    Registered forum members do not see this ad.

    sir can you give me last time changes in the lisp file? i want to label generate the single time at closest Polyline.

Similar Threads

  1. Need help to create polyline edge road
    By tieptouch in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 31st Mar 2014, 09:04 am
  2. snapping to an edge
    By raymarcher in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 12th May 2011, 04:32 pm
  3. Help moving the edge of a circle precisely to the edge of a line
    By berol in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 15th Feb 2011, 05:05 pm
  4. Opening a polyline on the edge selected
    By DWG Destroyer in forum AutoLISP, Visual LISP & DCL
    Replies: 22
    Last Post: 9th Nov 2009, 08:26 pm
  5. Help w/ Ogee edge
    By controversia in forum AutoCAD 3D Modelling & Rendering
    Replies: 4
    Last Post: 7th May 2008, 04:14 am

Tags for this Thread

Bookmarks

Posting Permissions

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