See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: HI.. GENTS .. I NEED HELP with lisp file

  1. #1
    Member
    Join Date
    2018-03
    Posts
    5
    Login to Give a bone
    0

    Default HI.. GENTS .. I NEED HELP with lisp file

    I NEED HELP FROM AUTOLISP PROGRAMMER ..
    I NEED LISP TO MAKE NUMBERING FROM POINTS GIVE LIKE FILE ATTACH ..
    PLEASE FROM ALL .. THANKS
    Attached Files Attached Files
    • File Type: dwg 4.dwg (831.3 KB, 26 views)

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

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    Have you searched for grid labeling its basicly the same. I dont have anything but its a case of using a double sort on the x y so can look at all common X 1st incrementing for Y and repeating for each X.

    This is a start sorts the points on x & Y
    Code:
    (defun gridxy ( / ss lst lst2)
    (setq ss (ssget "X" '(( 0 . "point"))))
    
    (setq lst2 '())
    (repeat (setq x (sslength ss))
    (setq lst '())
    (setq ent (entget (ssname ss (setq x (- x 1)))))
    (setq lst (cons (caddr (assoc 10 ent)) lst))
    (setq lst (cons (cadr (assoc 10 ent)) lst))
    (setq lst2 (cons lst lst2))
    )
    (setq lst2 (reverse lst2))
    
    ; sorts on 1st two items
    (setq lst2 (vl-sort lst2 '(lambda (x y)
    (cond
    ((= (cadr x)(cadr y))
    (< (car x)(car y)))
    ((< (cadr x)(cadr y)))
    ))))
    (princ)
    )
    (gridxy)
    Code:
    Your dwg
    ((462677.0 3.26445e+06) (462697.0 3.26445e+06) (462717.0 3.26445e+06) (462737.0 3.26445e+06) (462677.0 3.26447e+06) (462697.0 3.26447e+06) (462717.0 3.26447e+06) (462737.0 3.26447e+06))
    Last edited by BIG-AL; 2018-04-17 at 11:21 AM.

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

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    Thinking a bit more its probably easier to just pick x spacing, pick y spacing, how many in x direction how many in Y direction, erase any not needed. Have to do real work right now.

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

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    All I have to do now is get this to work
    Code:
    (setq pt1 (getpoint "Pick 1st point cnr"))
    (setq x1 (car pt1))
    (setq y1 (cadr pt1))
    (setq x 1)
    (setq y 1)
    (setq d1 (GETDIST PT1 "2nd point X"))
    (setq d2  (getdist PT1 "2ND PT y"))
    (SETQ Xmany (GETINT "How many in x direction"))
    (setq ymany (getint "How many in Y direction"))
    (setq ansx "A00")
    (setq ansy "B00")
    
    (repeat ( + ymany 1)
    (repeat ( + xmany 1)
    (setq  pt (list x1 y1))
    (command "text" pt "1" "" (strcat ansx (rtos x 2 0) ansy (rtos  y  2 0)))
    (setq x1 (+ x1 d1))
    (setq  x (+  x 1))
    )
    (setq   x 1)
    (setq  x1(car pt1))
    (setq  y1 (+ y1 d2))
    (setq Y (+ y 1))
    )

  5. #5
    Member
    Join Date
    2018-03
    Posts
    5
    Login to Give a bone
    0

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    thank you for quick reply
    but the lisp not work
    i want number depend on base points ..
    please help me

  6. #6
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    1

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    Do you mean , this way?

    label points.GIF

  7. #7
    Member
    Join Date
    2018-03
    Posts
    5
    Login to Give a bone
    0

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    Yes.. I have 2 line with base points.. I want renumber like ur Pic with respect Y line as A00x and X line as B00x..
    The result for number point.. A001B001
    Thx

  8. #8
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    Just thought I would post this its a work in progress so dont expect to much it produces a result close to what is required. Unfortunatley ran out of time but will finish over the next few days. Devigt welcome to run with it.

    Code:
    (setq pt1 (getpoint "Pick 1st point cnr"))
    (setq x1 (car pt1))
    (setq y1 (cadr pt1))
    (setq x 1)
    (setq y 1)
    (setq d1 (GETDIST PT1 "2nd point X"))
    (setq d2  (getdist PT1 "2ND PT y"))
    (SETQ Xmany (GETINT "How many in x direction"))
    (setq ymany (getint "How many in Y direction"))
    (setq ansx "A00")
    (setq ansy "B00")
    
    (repeat ( + ymany 1)
    (repeat ( + xmany 1)
    (setq  pt (list x1 y1))
    (command "text" pt "1" "" (strcat ansx (rtos x 2 0) ansy (rtos  y  2 0)))
    (setq x1 (+ x1 d1))
    (setq  x (+  x 1))
    )
    (setq   x 1)
    (setq  x1(car pt1))
    (setq  y1 (+ y1 d2))
    (setq Y (+ y 1))
    )

  9. #9
    Member
    Join Date
    2018-03
    Posts
    5
    Login to Give a bone
    0

    Default Re: HI.. GENTS .. I NEED HELP with lisp file

    HI BIG-AL
    THE LISP IS WORK .. LIKE THAT:
    (defun c:XY ( / ss lst lst2)
    (setq ss (ssget "X" '(( 0 . "point"))))


    (setq pt1 (getpoint "Pick 1st point cnr"))

    (setq x1 (car pt1))

    (setq y1 (cadr pt1))

    (setq x 1)

    (setq y 1)

    (setq d1 (GETDIST PT1 "2nd point X"))

    (setq d2 (getdist PT1 "2ND PT y"))

    (SETQ Xmany (GETINT "How many in x direction:"))

    (setq ymany (getint "How many in Y direction:"))

    (setq ansx "B00")

    (setq ansy "A00")


    (repeat ( + ymany 1)

    (repeat ( + xmany 1)

    (setq pt (list X1 Y1))

    (command "text" pt "1" "" (strcat ansx (rtos x 2 0) ansy (rtos y 2 0)))

    (setq x1 (+ x1 d1))

    (setq x (+ x 1))
    )

    (setq x 1)

    (setq x1(car pt1))

    (setq y1 (+ y1 d2))

    (setq Y (+ y 1))
    )
    (princ)
    )

    BUT I WANT CHANGE THE ARRANGEMENT ,, IT COME LIKE B001A001
    I WANT BEGIN A001B001
    THX

Similar Threads

  1. Replies: 0
    Last Post: 2015-10-21, 05:54 PM
  2. lisp file
    By samtom123 in forum AutoLISP
    Replies: 2
    Last Post: 2008-07-22, 05:11 AM
  3. Importing csv file to lisp
    By jitesh789 in forum AutoLISP
    Replies: 1
    Last Post: 2008-07-13, 12:49 PM
  4. I don't know how to look at this Lisp file
    By spaynter in forum AutoLISP
    Replies: 4
    Last Post: 2005-08-26, 07:02 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
  •