Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: HELP WITH DIVIDE LISP PROGRAM

  1. #11
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Certainly Patrick, give this a try:

    Code:
    (defun c:test ( / _circle p1 p2 no di an sp i ucsz )
    
      (defun _circle ( center radius )
        (entmakex (list (cons 0 "CIRCLE") (cons 10 center) (cons 40 radius) (cons 210 ucsz)))
      )
      (setq ucsz (trans '(0. 0. 1.) 1 0 t))
    
      (if
        (and
          (setq p1 (getpoint "\nSpecify First Point: "))
          (setq p2 (getpoint "\nSpecify Second Point: " p1))
          (progn
            (initget 6)
            (setq no (getint "\nSpecify Number of Circles: "))
          )
          (setq di (getdist "\nSpecify Diameter of Circles: "))
        )
        (progn
          (setq p1 (trans p1 1 ucsz) p2 (trans p2 1 ucsz)
                an (angle p1 p2)     di (/ di 2.)
                p1 (polar p1 an di)  p2 (polar p2 an (- di))
          )
          (if (= 1 no)
            (setq sp (/ (distance p1 p2) 2.) i 0)
            (setq sp (/ (distance p1 p2) (1- no)) i -1)
          )      
          (repeat no (_circle (polar p1 an (* (setq i (1+ i)) sp)) di))
        )
      )
      (princ)
    )

  2. #12
    Member
    Join Date
    2009-03
    Posts
    7
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    perfect. thank you

  3. #13
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    You're welcome Patrick

  4. #14
    Member
    Join Date
    2013-04
    Posts
    25
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Quote Originally Posted by Lee Mac View Post
    Certainly Patrick, give this a try:

    Code:
    (defun c:test ( / _circle p1 p2 no di an sp i ucsz )
    
      (defun _circle ( center radius )
        (entmakex (list (cons 0 "CIRCLE") (cons 10 center) (cons 40 radius) (cons 210 ucsz)))
      )
      (setq ucsz (trans '(0. 0. 1.) 1 0 t))
    
      (if
        (and
          (setq p1 (getpoint "\nSpecify First Point: "))
          (setq p2 (getpoint "\nSpecify Second Point: " p1))
          (progn
            (initget 6)
            (setq no (getint "\nSpecify Number of Circles: "))
          )
          (setq di (getdist "\nSpecify Diameter of Circles: "))
        )
        (progn
          (setq p1 (trans p1 1 ucsz) p2 (trans p2 1 ucsz)
                an (angle p1 p2)     di (/ di 2.)
                p1 (polar p1 an di)  p2 (polar p2 an (- di))
          )
          (if (= 1 no)
            (setq sp (/ (distance p1 p2) 2.) i 0)
            (setq sp (/ (distance p1 p2) (1- no)) i -1)
          )      
          (repeat no (_circle (polar p1 an (* (setq i (1+ i)) sp)) di))
        )
      )
      (princ)
    )
    Would it be difficult to modify so it can do like attached only pick the line or polyline instead of picking a distance? Thanks.

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

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    It had been 6 years since the post previous to your´s . Could it be possible you upload a dwg sample , and what you have before , and how to show after te lisp???

  6. #16
    Member
    Join Date
    2013-04
    Posts
    25
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Quote Originally Posted by devitg.89838 View Post
    It had been 6 years since the post previous to your´s . Could it be possible you upload a dwg sample , and what you have before , and how to show after te lisp???
    Certainly.
    I'd be ever so grateful if you could help with this. I work in interior design quite often and the clients are very particular about EQ spacing of objects.

    See drawing attached.
    Attached Files Attached Files

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

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Hi 3dwanab, would always the objects be a regular shape shape , say 2d , circle, poly, and so on , or there is , say, irregular shapes, if possible upload some samples , not equal to the 3 shown.

    If you do not want to upload here , for any reason, you can send it to my email , as at the attached file.
    Attached Files Attached Files

  8. #18
    Member
    Join Date
    2013-04
    Posts
    25
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    That pretty much it. Those 3 examples are all I will use. I'd rather keep it on the forum in case it's against forum rules.

    So. Circles, Squares and blocks. Which I assume could be irregular. But I never have used them.

    Just thought it would be good to add that.

    So squares and circles will suffice.

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

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Ok . Let it to be so , Regular shapes .

    How many of it it must be at each space?

  10. #20
    Member
    Join Date
    2013-04
    Posts
    25
    Login to Give a bone
    0

    Default Re: HELP WITH DIVIDE LISP PROGRAM

    Like the attached drawing. The object, object count and total distance are the three variables.

    If the program could update when typing the array value without exiting the command (double return to accept, I dunno) and printing the spacing distance to the commandline.

    Sorry only after thinking that would be nice.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Need Lisp for divide polyline in custom length
    By radosak368138 in forum AutoLISP
    Replies: 12
    Last Post: 2015-07-29, 12:31 AM
  2. Replies: 2
    Last Post: 2015-07-27, 05:10 AM
  3. Convert old program to LISP
    By dandrejco in forum AutoLISP
    Replies: 3
    Last Post: 2012-10-12, 09:17 PM
  4. Help with a lisp program
    By Glen_Johnston in forum AutoLISP
    Replies: 7
    Last Post: 2005-04-07, 08:34 PM
  5. LISP program
    By mishgass in forum AutoLISP
    Replies: 5
    Last Post: 2005-03-17, 05:14 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
  •