Author Topic: cut lines  (Read 6279 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
cut lines
« on: October 04, 2004, 10:33:07 AM »
i was just wondering if anybody has a routine for inserting cutlines. i'm looking for something that will insert 2 cutlines allowing the user to pick the distance between them then allowing the user to trim out the objects between. anyone have something like that?

hyposmurf

  • Guest
cut lines
« Reply #1 on: October 04, 2004, 02:32:49 PM »
I think i know where your going with this one.Are you hoping to use the cut lines to cut a piece of pipework so that it no longer looks like it inetersects with another?
http://theswamp.org/phpBB2/viewtopic.php?t=1270&highlight=pipework

ELOQUINTET

  • Guest
cut lines
« Reply #2 on: October 04, 2004, 02:37:38 PM »
no not at all i'm in metal fabrication and just want an easy cutline routine instead of having to place one then place another then trim. i would like to be able to place them both then have those two lines be selected as trim lines and just selected the lines i'd like to trim all in one routine. wala done...

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
cut lines
« Reply #3 on: October 04, 2004, 03:01:26 PM »
dan
How would you place them, the cut lines?
How do you do it now, exactly that is?
Do you pick an existing line to offset?
Do you draw two lines?
If so how do you determine where to draw them?Do you have a centerline object?
If you want a routine to do a specific task, you must define the task specifically. 8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
cut lines
« Reply #4 on: October 04, 2004, 03:30:29 PM »
Just a follow up to CAB's post,

ya know what they say about pictures......... :D
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
cut lines
« Reply #5 on: October 04, 2004, 04:51:33 PM »
ok here's my littl drawing for ya hope this helps explain


[/url]http://theswamp.org/lilly_pond/dan/CUTLINE.PNG?nossi=1http://

ELOQUINTET

  • Guest
cut lines
« Reply #6 on: October 04, 2004, 04:52:21 PM »
URRRRRR

[/url]http://theswamp.org/lilly_pond/dan/CUTLINE.PNG?nossi=1[url]

ELOQUINTET

  • Guest
cut lines
« Reply #7 on: October 04, 2004, 04:52:45 PM »
AH SCREW IT IT'S HERE ^

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
cut lines
« Reply #8 on: October 04, 2004, 05:18:01 PM »
Quote from: eloquintet
URRRRRR

how about this ......... BTW you don't need to use [url] on complete URL's
http://theswamp.org/lilly_pond/dan/CUTLINE.PNG?nossi=1
TheSwamp.org  (serving the CAD community since 2003)

hyposmurf

  • Guest
cut lines
« Reply #9 on: October 04, 2004, 05:44:32 PM »
Your trying to do a similar thing to the thread I posted,never worked how to do it though.Your trying to add two lines and have them trim whats inside them.Im trying to do that but then have the two lines deleted,once theyve trimed.Curently have to create two lines,trim inside them and then delete them,bit like a triming template,its annoyingly slow when you have 100's of pipe intersections.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
cut lines
« Reply #10 on: October 04, 2004, 09:13:29 PM »
dan
Here is one I use. I just updated the single break symbol code and the other
option is disabled for now.
Code: [Select]
;;; Lisp to draw Single or Double "Z" Break Lines
;;;                 © A.Henderson 2002
;;;
;;;  Modified By Charles Alan Butler  10/02/2004
;;;  To allow any angle and to trim lines that
;;;  do not run through both break symbols
;;;  Disabled Double Brk Sym until I fix that
;;;

(defun c:dz (/ oldlay oldotho oldosmode ztype dist p1 p2 p3 p4 p5 p6 e1 e2
             evl1 evl2 ang1 ang2 x lst)
  ;; return vertex list by MP
  (defun cdrs (key lst / pair rtn)
    (while (setq pair (assoc key lst))
      (setq rtn (cons (cdr pair) rtn)
            lst (cdr (member pair lst))
      )
    )
    (reverse rtn)
  )
 
  ;;  set osnaps ON/OFF
(defun SetOsnaps (value) ; value = "ON" or default to "OFF"
  (if value (setq value (strcase value)))
  (cond
    ((OR (AND(= value "ON") (>= (getvar "osmode") 16383))
         (AND(/= value "ON") (<= (getvar "osmode") 16383))
      )
      (setvar "osmode" (boole 6 (getvar "osmode") 16384))
    )
  )
)

  ;;   Start of routine  ==================================
  ;;  Save settings
  (setq oldlay    (getvar "clayer")
        oldortho  (getvar "orthomode")
        oldosmode (getvar "osmode")
  ) ;_ end of setq
  ;;  I use current layer - CAB
  ;;(command ".layer" "make" "Z-Line" "Colour" "41" "" "")


 ;(initget "S D")
 ;(setq ztype (getkword "\n Single or Double -^v-^v- ? (S or D) <S>"))
  (setq ztype "S")
  (SetOsnaps "ON") ; force on
  ;;===========================================
  (if (and (setq p1 (getpoint "Starting point of break line : "))
           (setq p6 (getpoint p1 "End point of break line : "))
      )

    ;;===========================================
    (cond
      ((/= ztype "D") ; default to single
       (setq dist (distance p1 p6)
             ang  (angle p1 p6)
             p2   (polar p1 ang (* 0.4167 dist))
             p5   (polar p1 ang (* 0.5833 dist))
             p3   (polar p2 (+ 1.25664 ang) (* 0.1667 dist))
             p4   (polar p5 (+ 4.39824 ang) (* 0.1667 dist))
       ) ;_ end of setq
       (setvar "plinewid" 0)
       (SetOsnaps "OFF") ; force off
       (command "pline" p1 p2 p3 p4 p5 p6 "") ; Draw the Z-Line
       (setq e1 (entlast))
       (setvar "osmode" oldosmode) ; return to original state        
       (command ".pedit" e1 "L" "ON" "")
       (command ".copy" e1 "" p6 pause)
       (setq e2 (entlast))
       (setq evl1 (cdrs 10 (entget e1)) ; ent vertex list
             evl2 (cdrs 10 (entget e2))
             ang1 (angle p1 (car evl2))
             ang2 (angle (car evl2) p1)
       )

       (initget "Y N")
       (setq ztype (getkword "\n Do you wish to trim the lines now ? (Y or N) <N>"))

       (if (= ztype "Y")
         (progn
           (setq lst '())
           (foreach x evl1
             (setq lst (cons (polar x ang1 1) lst))
           )
           (foreach x (reverse evl2)
             (setq lst (cons (polar x ang2 1) lst))
           )
           (SetOsnaps "OFF") ; force off
           (command ".trim" e1 e2 "" "F")
           (apply 'command lst)
           (command "" "")
         )
       ) ;_ end of if
      ) ;_ end of if

      ;;===========================================
      ((= ztype "D")
       (setq dista  (distance pt1 pt2)
             dist1  (* 0.26 dista)
             dist2  (* 0.34 dista)
             dist3  (* 0.37 dista)
             dist4  (* 0.64 dista)
             dist5  (* 0.71 dista)
             dist6  (* 0.74 dista)
             zangle 1.396263402
             ang1   1.117010721
             ang2   1.588249619
             ang3   1.256637061
             ang4   1.483529864
             z1     (polar pt1 zangle dist1)
             z2     (polar pt1 ang1 dist2)
             z3     (polar pt1 ang2 dist2)
             z4     (polar pt1 zangle dist3)
             za     (polar pt1 zangle dist4)
             zb     (polar pt1 ang3 dist5)
             zc     (polar pt1 ang4 dist5)
             zd     (polar pt1 zangle dist6)
             zx     (polar pt1 zangle dista)
       ) ;_ end of setq

       (command ".pline" pt1 z1 z2 z3 z4 za zb zc zd zx "") ; Draw the Z-Line
       (setq z2line (entlast))
       (setvar "orthomode" 1)
       (command ".pedit" z2line "L" "ON" "")
       (command ".copy" z2line "" zx pause)
       (setvar "orthomode" 0)
       (setq pt2b (getvar "lastpoint")) ; ? error check CAB compare to pt1
       (setq trimdist2 (/ (distance zx pt2b) 2)
             td2x      (car zx)
             td2y      (cadr zx)
             x2point   (+ td2x trimdist2)
             trp1      (list x2point td2y)
             trp2      (list (+ (car zd) trimdist2) (cadr zd))
             trp3      (list (+ (car zc) trimdist2) (cadr zc))
             trp4      (list (+ (car zb) trimdist2) (cadr zb))
             trp5      (list (+ (car za) trimdist2) (cadr za))
             trp6      (list (+ (car z4) trimdist2) (cadr z4))
             trp7      (list (+ (car z3) trimdist2) (cadr z3))
             trp8      (list (+ (car z2) trimdist2) (cadr z2))
             trp9      (list (+ (car z1) trimdist2) (cadr z1))
             trp10     (list (+ (car pt1) trimdist2) (cadr pt1))
       ) ;_ end of setq

       (initget "Y N")
       (setq ztype (getkword "\n Do you wish to trim the lines now ? (Y or N) <N>"))
       (if (= ztype "Y")
         (command ".trim" pt1 pt2b "" "F" trp1 trp2 trp3 trp4 trp5 trp6 trp7 trp8 trp9 trp10 "" "") ;_ end of command
       ) ;_ end of if
      ) ;_ end cond
    ) ; end cond stmt
  ) ; endif
  ;;================
  ;;  Exit sequence
  ;;================\
  ;;  Restore settings
  ;;  I use current layer - CAB
  ;;(command ".layer" "set" oldlay "")
  (setvar "orthomode" oldortho)
  (setvar "osmode" oldosmode)
  (princ)
) ;_ end of defun
(prompt
  "\nDouble Break Symbol Creator loaded.  Type DZ to run it."
)
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
cut lines
« Reply #11 on: October 04, 2004, 10:24:12 PM »
ok cab i'll give it a shot tomorrow thanks so much for your hard work this has been annoying me for quite some time. and thanks smurf for your help too  :wink:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
cut lines
« Reply #12 on: October 04, 2004, 11:43:58 PM »
Quote from: hyposmurf
Your trying to do a similar thing to the thread I posted,never worked how to do it though.Your trying to add two lines and have them trim whats inside them.Im trying to do that but then have the two lines deleted,once theyve trimed.Curently have to create two lines,trim inside them and then delete them,bit like a triming template,its annoyingly slow when you have 100's of pipe intersections.


Sorry I don't remember the thread, can you point me to it?
Or discribe exactly what you are trying to do?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hendie

  • Guest
cut lines
« Reply #13 on: October 05, 2004, 03:20:47 AM »
Quote from: CAB
dan
Here is one I use. I just updated the single break symbol code and the other
option is disabled for now.


heh.. CAB, I was thinking of reposting that yesterday when I saw the thread but the original was so lame and I wrote it so long ago I was a bit embarrassed about it.
I have been meaning to revisit it for so long to accommodate using any angle for input but .. y'know how it goes... just never got around to it.

(it's always embarrassing when your "early" lisps come back to haunt you !).. but hopefully you've prompted me to revisit it again in the near future.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
cut lines
« Reply #14 on: October 05, 2004, 08:02:02 AM »
Quote from: hendie
heh.. CAB, I was thinking of reposting that yesterday when I saw the thread but the original was so lame and I wrote it so long ago I was a bit embarrassed about it.
I have been meaning to revisit it for so long to accommodate using any angle for input but .. y'know how it goes... just never got around to it.

(it's always embarrassing when your "early" lisps come back to haunt you !).. but hopefully you've prompted me to revisit it again in the near future.

Yes, we learned a lot in the last two years.
I to have many lisp that when I look at them again I wonder why I did it that way.
But at least you got the job done & I have been using this lisp for a year, so thanks
for that. I wrote a single break line routine some time back that could be drawn at
any angle and I was going to update yours to include that feature but as you say
I never got around to it. :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.