+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Senior Member
    Discipline
    Construction
    wimal's Discipline Details
    Occupation
    cadoperator
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Oct 2011
    Location
    sri lanka
    Posts
    488

    Default Points of leader

    Registered forum members do not see this ad.

    Code:
    (setq pt(nentsel (strcat "\n Select a leader  < exit > : ")));get entity
    (setq e (entget (car pt)));;association list of entity
    (setq p1 (assoc 10 e))
    How can I get 3 points of leader.
    Attached Images

  2. #2
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    802

    Default

    Use the lisp function MEMBER It searches a list for an occurrence of an expression and returns the remainder of the list, starting with the first occurrence of the expression so:
    Code:
    (defun C:test (/ e pt p2 p3)
    	(setq pt(nentsel (strcat "\n Select a leader  < exit > : "))
    	      e (entget (car pt));;association list of entity
    	      e (member (assoc 10 e) e)
    	      p1 (cdr (assoc 10 e));; cdr removes the 10 leaving the coordinates.
    	      e (cdr e)
    	      p2 (cdr (assoc 10 e))
    	      e (cdr e)
    	      p3 (cdr (assoc 10 e))
    	)
            (princ "\np1=")(princ p1)(princ ", p2=")(princ p2)(princ ", p3=")(princ p3)(princ)
    )
    should return what you're looking for.
    You may want to search for qlset.lsp by Frank Whaley who worked for Autodesk. This code allows you to examine the current QLEADER settings, or to initialize the setting before using the QLEADER command. It can tell you how many points the leader has for example. Not everyone uses the default settings.
    Last edited by tombu; 16th May 2018 at 12:49 pm. Reason: Added output
    Layer 0 for ByBlock Block entities, everything else ByLayer. So many issues can be solved with good templates.

  3. #3
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,446

    Default

    First define a function that will check for that group code key, and return its value:
    Code:
    (defun IsItDxf10 ( x )
      (if (= (car x) 10) (cdr x))
    )
    Second learn how to use vl-remove-if-not function to retrieve the items from the list that match the function's criteria.
    Assuming that you know the dxf elist is obtained via (entget <ename>).

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,533

    Default

    Use a method similar to that which I describe here.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Senior Member
    Discipline
    Construction
    wimal's Discipline Details
    Occupation
    cadoperator
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Oct 2011
    Location
    sri lanka
    Posts
    488

    Default

    Registered forum members do not see this ad.

    Thanks all fore helping me.

Similar Threads

  1. Variable to set number of points in a Leader
    By rubio_jose in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 6th Oct 2017, 09:19 pm
  2. Leader to Multi-Leader and auto attaching with closet Dtext or Mtext
    By kite15 in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 22nd Mar 2016, 10:08 am
  3. Leader annotation bind to leader
    By wimal in forum AutoCAD General
    Replies: 3
    Last Post: 15th Jul 2013, 07:35 am
  4. LISP for Room Size 2 horizontal points & 2 vertical points
    By nihar in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 2nd Jan 2013, 02:53 am
  5. Replies: 0
    Last Post: 5th Apr 2012, 08:15 pm

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