See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Lisp to trim/ break a polyline or line

  1. #1
    Login to Give a bone
    0

    Default Lisp to trim/ break a polyline or line

    Hi guys, just new to the autolisp world and would like to ask your assistance in making a lisp so it can be a basis for my future lisp programs.


    Here is the flow of the lisp.

    Overview: the lisp trims or break a polyline or a line a the point (midpoint) indicated by the user by a value specified by a user.
    The distance value indicated should be followed even if the polyline or line is angled.

    First: the user is asked of how much the value of the trim/ break to be done on the polyline or line.
    2nd : the user is asked to chose the point where the trim / break will be done.
    3rd: click the next point on the line or polyline or press esc to exit.

    Sample, I inputted 1000mm for the value and click at the midpoint of the polyline, the trim should be 500mm on both side of the polyline.
    As long as I don’t cancel, I will just continue to choose the next point to trim/ break.


    Thank you in advance and more power

  2. #2
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Lisp to trim/ break a polyline or line

    Without using ActiveX and just using the command functions.

    P=

    Code:
    (defun C:BAMP ()
     (C:BreakAtMidPoint)
    )
    
    (defun C:BreakAtMidPoint (/ entItem lstPoint sngDistance)
     (if (setq sngDistance (getdist "\nEnter Break Length: "))
      (while (and
              (vl-cmdf "circle" "Mid" pause)
              (vl-cmdf (/ sngDistance 2.0))
              (setq entItem (entlast))
              (setq lstPoint (getvar "lastpoint"))
             )
       (vl-cmdf "trim" entItem "" "Nea" lstPoint "")
       (vl-cmdf "erase" entItem "")
       (setq entItem nil)
      )
     ) 
    )
    (vl-load-com)
    AutomateCAD

  3. #3
    Login to Give a bone
    0

    Default Re: Lisp to trim/ break a polyline or line

    Hi Peter,

    Wow same name. Thanks for the code. Nice strategy of using a circle works great. Thank you very much.

  4. #4
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Colorado Springs, CO
    Posts
    369
    Login to Give a bone
    1

    Default Re: Lisp to trim/ break a polyline or line

    Pretty powerful break routine here: http://www.theswamp.org/index.php?topic=10370.0

Similar Threads

  1. Automated Trim/Break at a specified dist for a Line
    By ameador in forum AMEP General
    Replies: 6
    Last Post: 2009-08-07, 03:17 PM
  2. Trim a polyline with lisp
    By cadconcepts in forum AutoLISP
    Replies: 4
    Last Post: 2009-03-04, 10:22 AM
  3. LISP trim/break line inserting block
    By aldiyars1925 in forum AutoLISP
    Replies: 1
    Last Post: 2008-09-09, 01:33 PM
  4. Trim a Wall to a Break Line
    By CADdancer in forum ACA General
    Replies: 10
    Last Post: 2008-04-01, 01:57 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
  •