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 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,Originally Posted by tany0070
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
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.
I couldnt get it to work either, plus it zoomed extents
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 "" "")
Last edited by tany0070; 2007-04-11 at 06:29 AM.
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.
My two cents...
btw this doesnt work but just a suggestion lol proberly too simpleCode:(defun c:te() (setq ss1 (ssget)) (setq ss2 (ssget)) (command "trim" ss2 "" ss1 "") (command "extend" ss2 "" ss1 "") (princ) )
ok but how do you control the parts to trim, it always seem to trim off the parts that i wantOriginally Posted by Mr Cory
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
i see never mind then, thanks.