Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Extend and Trim lines to an enclosed boundary

  1. #1
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Extend and Trim lines to an enclosed boundary

    hi pple, need help with commands trim and extend, anyone know how to make the program extend lines within an enclosed fence and trim off any that are outside the fence? thanks.

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    Quote Originally Posted by tany0070
    hi pple, need help with commands trim and extend, anyone know how to make the program extend lines within an enclosed fence and trim off any that are outside the fence? thanks.
    Hi tany,
    Do you mean like this code
    Code:
    (defun c:test (/ f2 lst om ss ssn1 ssn2)
      (princ "\nSelect alls object line")
      (if
        (setq ss (ssget '((0 . "LINE"))))
        (progn
          (setq ssn1 (ssname ss 0))
          (setq ssn2 (ssname ss 1))
          (setvar "osmode" 1)
          (setq str "\nPick a line to would extend")
          (setq f2 (osnap (cadr (entsel str)) "endp"))
          (setvar "osmode" 0)
          (command "_extend" ssn1 ssn2 "" "e" "e" f2 "")
          (command "_zoom" "e")
          )     ; progn
        (alert "\nThere is not object line")
        )       ; if
      (princ)
      )         ; defun

  3. #3
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    i'm sorry but this code doesn't seem to work for me but thanks for the quick reply, maybe this drawing will help, i wish to extend the white lines so that they occupy the inner parts of the yellow trapizium like boarder and trim off any that are beyond the boarder, with as minimal user interface as possible. thanks.
    Attached Images Attached Images

  4. #4
    AUGI Addict Mr Cory's Avatar
    Join Date
    2007-01
    Location
    Under a Rock over there
    Posts
    1,006
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    I couldnt get it to work either, plus it zoomed extents

  5. #5
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    ok, i tried doing so using the following code but part of the drawing does not extend. i also tried the same with the trim code but it trims off the inner lines instead of the desired outer lines,pls help thanks.

    (setq bound (ssget "X" '((8 . "outline 1"))))
    (setq lg (ssget "X" '((8 . "temp"))))
    (command "_extend" bound "" lg "" "")
    (command "_trim" bound "" lg "" "")
    Attached Images Attached Images
    Last edited by tany0070; 2007-04-11 at 06:29 AM.

  6. #6
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    ok maybe i will be better if i ask how the trim and extend command should be written in Lisp so that they can perform to expectations, tried doing it manually in autoCAD and the result turned out find, so can any one suggest me some kind of secret formular to make it work properly. thanks.

  7. #7
    AUGI Addict Mr Cory's Avatar
    Join Date
    2007-01
    Location
    Under a Rock over there
    Posts
    1,006
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    My two cents...

    Code:
    (defun c:te()
      (setq ss1   (ssget))
      (setq ss2   (ssget))
    (command "trim" ss2 "" ss1 "")
    (command "extend" ss2 "" ss1 "")
    (princ)
    )
    btw this doesnt work but just a suggestion lol proberly too simple

  8. #8
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    Quote Originally Posted by Mr Cory
    My two cents...

    Code:
    (defun c:te()
      (setq ss1   (ssget))
      (setq ss2   (ssget))
    (command "trim" ss2 "" ss1 "")
    (command "extend" ss2 "" ss1 "")
    (princ)
    )
    btw this doesnt work but just a suggestion lol proberly too simple
    ok but how do you control the parts to trim, it always seem to trim off the parts that i want

  9. #9
    AUGI Addict Mr Cory's Avatar
    Join Date
    2007-01
    Location
    Under a Rock over there
    Posts
    1,006
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    Well i had hoped if it had worked that it would just work eg the line wouldnt extend outside the selected cut line, but it may require you to select some points either side of the line for the trim and extend to use. My limited knowledge stops their, not too sure how to write that into a lisp sorry

  10. #10
    100 Club
    Join Date
    2007-02
    Posts
    148
    Login to Give a bone
    0

    Default Re: Extend and Trim lines to an enclosed boundary

    i see never mind then, thanks.

Page 1 of 2 12 LastLast

Similar Threads

  1. click near lines to trim or extend
    By 742850517357521 in forum AutoLISP
    Replies: 2
    Last Post: 2013-02-14, 02:38 AM
  2. trim/extend
    By kwanjuju in forum AMEP General
    Replies: 0
    Last Post: 2008-03-17, 06:57 PM
  3. Trim not trimming back to selected trim boundary
    By Wwhite72082 in forum AutoCAD General
    Replies: 7
    Last Post: 2007-03-23, 01:47 PM
  4. Area Boundary Lines - Trim preference
    By Steve_Stafford in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2004-07-15, 12:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •