See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: Please help with small lisp modification

  1. #1
    Login to Give a bone
    0

    Default Please help with small lisp modification

    The attached lisp selects all closed polylines in a drawing and for each one writes a line in a file (list of coordinates in form Y,X or north,east). I would like to modify it to repeat the first point at the end of each line.

    For example, in a drawing with 2 closed polylines, the output looks like this:

    300,500 300,550 250,550 250,500
    300,700 300,750 250,750 250,700
    end of file

    And I would like it to look like this:

    300,500 300,550 250,550 250,500 300,500
    300,700 300,750 250,750 250,700 300,700
    end of file

    Thank you!
    Attached Files Attached Files

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    1

    Default Re: Please help with small lisp modification

    If writing to file why not each point 1 line ? Just use a blank line to seperate.

    Anyway it is making a list of points just add the (last pointinlist) before writing to file.
    Code:
    (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget plent))))
    (setq co-ord (cons (last co-ord) co-ord))

Similar Threads

  1. Hi Helpers, Need a urgent help in small modification of lisp code
    By brahmanandam.thadikonda762224 in forum AutoLISP
    Replies: 3
    Last Post: 2018-09-28, 04:42 AM
  2. Need a help in modification of lisp. Please update the lisp code as required.
    By brahmanandam.thadikonda762224 in forum AutoLISP
    Replies: 0
    Last Post: 2018-09-20, 04:12 AM
  3. Modification to a lisp (needs to change the lisp code)
    By nanaji130285733687 in forum AutoLISP
    Replies: 3
    Last Post: 2016-11-21, 04:45 AM
  4. Small Modification Required, In Existing Lisp
    By prasadcivil in forum AutoLISP
    Replies: 2
    Last Post: 2016-10-11, 05:45 AM
  5. Replies: 1
    Last Post: 2008-11-04, 05:48 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
  •