+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 29
  1. #1
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2012
    Posts
    11

    Default HELP needed with Autocad lisp!!!

    Registered forum members do not see this ad.

    I am in a hurry with the project so I don't have time to write this lisp myself specially couse I don't have any experience in it, so if anyone can help that would be great. Anyway I have a lot of parcels drawn in autocad and what i need to do is trim all the polyline endings and intersections and insert a point in the middle. Manually I do it this way:
    - first i make circles (radius has to be 0.5) on the endings and intersections of polylines
    - then I trim all the lines inside the circles
    - then I insert a point in the center of circles and at the end delete circles.

    There is also a picture at the bottom showing the first and the last fase of the process.

    If anyone knows about the lisp that does that or maybe have time to write one it would help me a lot.

    Thanks in advance. :-)cadtutor1.jpg

  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 4000, 2GB 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 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,138

    Default

    Would it be possible to get the same affect if you created a block of a point and used a mask to block the ends of the lines? This block could then be inserted at each intersection.

    In the future, to avoid a panic, it is best to seek an answer to a problem before you are on the threshold of your deadline. Just some friendly advice. No offense meant.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  3. #3
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,633

    Default

    Create a block containing a wipeout and a point, insert it on all the corners and then turn off the wipeout frames.

    Here is what it looks like

    blockit.png

  4. #4
    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 4000, 2GB 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 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,138

    Default

    What he ^ ^ ^ said works for me. Plus he said it much better than I did too. LoL
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  5. #5
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2012
    Posts
    11

    Default

    Thanks but how do I make such a block? And can I insert it automaticly on every intersection and ending of polyline?

  6. #6
    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 4000, 2GB 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 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,138

    Default

    You make it like any other block??

    Automatically insert the block at every intersection? Is that practical? How many intersections are there?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  7. #7
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2012
    Posts
    11

    Default

    Sorry for a delay on answer. Didn't have internet. There are many intersections and I have to do the sam thing on all polyline endings so the number is big. That's why I asked is there a way to insert them automatically to save time. Anyways I know how to make a block but I don't understand how to make a block containing a whipeout?!

  8. #8
    Luminous Being StykFacE's Avatar
    Computer Details
    StykFacE's Computer Details
    Operating System:
    Windows 7 Ultimate 64bit
    Computer:
    Dell Precision T3500
    Discipline
    Multi-disciplinary
    StykFacE's Discipline Details
    Occupation
    BIM Manager & Design Specialist
    Discipline
    Multi-disciplinary
    Details
    Facilities engineering, involving mechanical piping, mechanical HVAC and electrical engineering.
    Using
    Revit 2013
    Join Date
    Mar 2006
    Location
    Dallas, TX - USA
    Posts
    6,497

    Default

    If you put in your thread title "Willing to Pay" you might get a better response.

    Or be patient... people are definitely generous but hope you can get someone to do something for you in time.
    Tannar Frampton | Facilities Engineering | Revit 2013
    Personal Projects | Fender Squier Stratocaster | Custom Smoker | Concrete Patio

  9. #9
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2012
    Posts
    11

    Default

    Good idea but I think I'm gonna wait a little more! :-)




    Quote Originally Posted by StykFacE View Post
    If you put in your thread title "Willing to Pay" you might get a better response.

    Or be patient... people are definitely generous but hope you can get someone to do something for you in time.

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Registered forum members do not see this ad.

    Here is some hastily written code, but should perform as required:

    trimparcel.gif
    Code:
    (defun c:trimparcel ( / a c d e h i l p s v )
        (if (setq s (ssget "_:L" '((0 . "LWPOLYLINE"))))
            (repeat (setq i (sslength s))
                (setq e (ssname s (setq i (1- i)))
                      d (entget e)
                      h (list
                            (assoc 8 d)
                            (cond ((assoc 06 d)) ('(06 . "BYLAYER")))
                            (cond ((assoc 62 d)) ('(62 . 256)))
                        )
                      v nil
                )
                (while (setq a (assoc 10 d))
                    (setq p (cdr a)
                          v (cons p v)
                          d (cdr (member a d))
                    )
                    (if (not (vl-some '(lambda ( x ) (equal p x 1e-8)) l))
                        (progn
                            (entmake (vl-list* '(0 . "POINT") (cons 10 p) h))
                            (setq l (cons p l))
                        )
                    )
                )
                (if (= 1 (logand 1 (cdr (assoc 70 (entget e)))))
                    (setq v (cons (last v) v))
                )
                (mapcar
                    (function
                        (lambda ( a b / x )
                            (if
                                (not
                                    (vl-some
                                        (function
                                            (lambda ( x )
                                                (or (and (equal a (car x) 1e-8) (equal b (cadr x) 1e-8))
                                                    (and (equal b (car x) 1e-8) (equal a (cadr x) 1e-8))
                                                )
                                            )
                                        )
                                        c
                                    )
                                )
                                (progn
                                    (setq c (cons (list a b) c)
                                          x (angle a b)
                                    )
                                    (entmake
                                        (vl-list*
                                           '(0 . "LINE")
                                            (cons 10 (polar a x 0.5))
                                            (cons 11 (polar b (+ x pi) 0.5))
                                            h
                                        )
                                    )
                                )
                            )
                        )
                    )
                    v (cdr v)
                )
                (entdel e)
            )
        )
        (princ)
    )
    (princ)
    Following the theme of Styk's post, perhaps make a contribution to my site if the above saves you time.
    Last edited by Lee Mac; 1st Oct 2012 at 12:01 am.
    Lee Mac Programming

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

    Just another Swamper

Similar Threads

  1. lisp needed
    By DEEPAKRAJ in forum AutoLISP, Visual LISP & DCL
    Replies: 38
    Last Post: 15th Apr 2012, 07:09 am
  2. A simple lisp needed
    By asos2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 28th Mar 2012, 06:24 pm
  3. Help needed with a Lisp .
    By Tharwat in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 4th Sep 2010, 10:46 pm
  4. LISP Needed
    By good_m in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 21st May 2009, 01:40 pm
  5. lisp needed
    By CadTechJGC184 in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 18th May 2009, 09:23 pm

Tags for this Thread

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