+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Spacing LISP

  1. #1
    Full Member
    Computer Details
    Paul H's Computer Details
    Operating System:
    W7
    Computer:
    Dell precision d3610
    CPU:
    Intel Xeon CPU E5-1650 v2 @ 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro K4000
    Monitor:
    2 x Acer V203H
    Using
    AutoCAD 2015
    Join Date
    Sep 2008
    Location
    London
    Posts
    28

    Default Spacing LISP

    Registered forum members do not see this ad.

    Hi

    Does anyone know of a LISP routine that would create a space between objects? Array would be fine for one object repeated, what if the objects were all different?

    I spend a lot of time manually spacing objects...

    Thanks

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,865

    Default

    Is the spacing random?

    I know of a VLX lisp program called Scatter:

    "move selected objects randomly in 2D or 3D - orchard, parking, crowd..."
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,995

    Default

    Quote Originally Posted by Paul H View Post
    Hi

    Does anyone know of a LISP routine that would create a space between objects? Array would be fine for one object repeated, what if the objects were all different?

    I spend a lot of time manually spacing objects...

    Thanks
    Whats the reason for the spacing? just moving the entities away from the next entitiy for clarity?

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,225

    Default

    Quote Originally Posted by pBe View Post
    Whats the reason for the spacing? just moving the entities away from the next entitiy for clarity?
    Hi pBe.

    Suppose that he has tens of Circles and Texts and wanted to separate them from each other with a specific length of distance ! So Array command won't
    allow him to select more than one entity at the same time .

    And to go with Move command , that's a matter of long time to do the trick .

    Thanks

  5. #5
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,995

    Default

    Quote Originally Posted by Tharwat View Post
    Hi pBe.

    Suppose that he has tens of Circles and Texts and wanted to separate them from each other with a specific length of distance !
    Thanks
    You think so tharwat? Anyway lets be patient. Its best that we wait for the OP to clarify that for us.

    Cheers

  6. #6
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,225

    Default

    I guess so , because he mentioned objects which gave me the inspiration to say it might be different sorts of entities .

    Cheers.

  7. #7
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,585

    Default

    It does not matter what it is, what counts is how you work out box size that contains the object, if you took 100 blocks and did a 10x10 grid chances are some blocks would be to big and overlap.

    You could do this in a number of ways read file/excell that sets size of box, create a new layout tab place block or objects and work out its extents min max this gives box size then erase all jump back and add object keep a record of x max and y max if multi rows required but do able. This is definately do able you get a different answer for extmin extmax for every layout tab.

  8. #8
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    Quickie. I'll clean it up and post some code tomorrow.
    spacer.gif

    EDIT:
    ahh, screw it, here (be forewarned, it's sloppy as hell):

    Code:
    (defun _bboxAndMid (obj / a b l)
      (vla-getboundingbox obj 'a 'b)
      (list (car (setq l (mapcar 'vlax-safearray->list (list a b))))
            (apply '(lambda (a b) (mapcar '(lambda (a b) (/ (+ a b) 2.)) a b)) l)
            (cadr l)
      )
    )
    
    (defun ss->lst (ss / i l)
      (if (eq (type ss) 'PICKSET)
        (repeat (setq i (sslength ss))
          (setq l (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) l))
        )
      )
    )
    
    
    
    
    (defun c:Test (/ lst p1 g p2 a d)
      (if (and (setq lst (ss->lst (ssget "_:L")))
               (setq p1 (getpoint "\nSpecify first point: "))
          )
    
        (while (eq 5 (car (setq g (grread T 15 0))))
          (redraw)
          (grdraw p1 (polar (setq p2 (cadr g)) (angle p1 p2) 10000000.) 1 -1)
    
          (setq p1 (trans p1 1 0)
                p2 (trans p2 1 0)
                a  (angle p1 p2)
                d  (/ (distance p1 p2) (float (length lst)))
          )
    
          (vla-move (car lst) (vlax-3d-point (cadr (_bboxAndMid (car lst)))) (vlax-3d-point p1))
    
          (mapcar
            '(lambda (o1 o2 / l)
               (vla-move o2
                         (vlax-3d-point (cadr (_bboxAndMid o2)))
                         (vlax-3d-point
                           (polar (cadr (setq l (_bboxAndMid o1)))
                                  a
                                  (+ d (distance (car l) (caddr l)))
                           )
                         )
               )
             )
            lst
            (cdr lst)
          )
        )
      )
      (redraw)
      (princ)
    )
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  9. #9
    Full Member
    Computer Details
    Paul H's Computer Details
    Operating System:
    W7
    Computer:
    Dell precision d3610
    CPU:
    Intel Xeon CPU E5-1650 v2 @ 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro K4000
    Monitor:
    2 x Acer V203H
    Using
    AutoCAD 2015
    Join Date
    Sep 2008
    Location
    London
    Posts
    28

    Default

    Thanks for all the quick responses guys!

    Thanks reMark, I do need ordered spacing though...

    Yeah pBe, it's basically laying out structures in order to dim up and annotate...

    Looks like alnajt's routine should do the trick, thanks mate...

    Love this site!

  10. #10
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,865

    Default

    Registered forum members do not see this ad.

    Nice job Alan.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

Similar Threads

  1. Pipe spacing
    By Nick-H- in forum MEP
    Replies: 0
    Last Post: 21st Oct 2010, 04:37 pm
  2. Text spacing help
    By Mason Dixon in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 9th Mar 2010, 04:22 am
  3. Text Spacing Lisp Routine
    By DAVIDA in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 18th May 2009, 03:30 pm
  4. Equal spacing
    By Slinger in forum AutoCAD General
    Replies: 5
    Last Post: 7th Feb 2006, 04:46 pm
  5. Text spacing
    By boofredlay in forum AutoCAD General
    Replies: 3
    Last Post: 14th Oct 2005, 07:41 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