Author Topic: PLINE JOIN  (Read 6762 times)

0 Members and 1 Guest are viewing this topic.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: PLINE JOIN
« Reply #15 on: November 17, 2005, 02:50:29 AM »
However I just remembered about This

I havent tried it myself yet, so I'm not sure about its content.

Happy reading.

T :-)
Thanks for explaining the word "many" to me, it means a lot.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: PLINE JOIN
« Reply #16 on: November 17, 2005, 08:23:58 AM »
I just got both links but I was signed up. :-)
Or perhaps Mark changed something.
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.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: PLINE JOIN
« Reply #17 on: November 17, 2005, 09:46:44 PM »
I am seeking a routine that will join a pline and offer a crossing or pick without having to go throuh all the PEDIT process....thanks

some info is missing here...
if you have 2 PLINEs or LINEs...
but in diffrent color and/or linetype....

How can you detect wich you need to joint ??

eg: you have a RED pline and a BLUE LINE...
you need to joint both..

but, need to take the BLUE layer...or color...or linetype...
if after making...you result was RED in wrong layer...
you do not have saved much time... and even worse.

isn't it ?

so that why i think crossing option is not good idea.  :kewl:
Keep smile...

whdjr

  • Guest
Re: PLINE JOIN
« Reply #18 on: November 18, 2005, 08:48:15 AM »
The one you pick first should be the dominent line.  If you pick blue then red then the new line will be blue.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: PLINE JOIN
« Reply #19 on: November 18, 2005, 01:23:35 PM »
Ok, I have wrote this..few year ago..
maybe the syntax is not perfect..but you can verify and modify as your own..

Code: [Select]
;;By Andrea Andreeti ;;
(defun c:joncline ()
  (ljgvar2nil)
  (setq ljg1_sel1 (entsel "Select line 1... "))
  (if (= ljg1_sel1 nil)(exit)
    (progn
  (setq ljg1_sel2 (entget (car ljg1_sel1)))
  (setq ljg_ent (cdr (assoc 0 ljg1_sel2)));;type d'entité
  (if (/= ljg_ent "LINE")(ljg_expline1))
  ))
  (setq ljg1_pt1 (cdr (assoc 11 ljg1_sel2)))
  (setq ljg1_pt2 (cdr (assoc 10 ljg1_sel2)))

 
  (setq ljg2_sel1 (entsel "Select line 2... "))
  (if (= ljg2_sel1 nil)(exit) 
    (progn
  (setq ljg2_sel2 (entget (car ljg2_sel1)))
  (setq ljg_ent (cdr (assoc 0 ljg2_sel2)));;type d'entité
  (if (/= ljg_ent "LINE")(ljg_expline2))
  ))
  (setq ljg2_pt1 (cdr (assoc 11 ljg2_sel2)))
  (setq ljg2_pt2 (cdr (assoc 10 ljg2_sel2)))

 
(setq dist_f1 (distance ljg1_pt1 ljg2_pt1))
(setq dist_f2 (distance ljg1_pt2 ljg2_pt1))
(if (> dist_f1 dist_f2)(setq spoint ljg1_pt2)(setq spoint ljg1_pt1))
 
(setq dist_f3 (distance spoint ljg2_pt2))
(setq dist_f4 (distance spoint ljg2_pt1)) 

(if (< dist_f3 dist_f4)(setq epoint ljg2_pt1)(setq epoint ljg2_pt2)) 

(if (= spoint ljg1_pt2)(setq pvar 10)(setq pvar 11)) 

(vl-cmdf "_erase" ljg2_sel1 "") 
 
(setq ljg1_sel2
  (subst  (cons pvar epoint)
    (assoc 11 ljg1_sel2)       
    ljg1_sel2                 
))
(entmod ljg1_sel2)
  (princ)

(ljgvar2nil) 
)


;; ;;
;; Capture du type d'entité ;;
;; ;;
(defun ljg_type  ()
  (if (or(/= ljg_ent "LINE")(/= ljg_ent "LWPOLYLINE"))
    (alert (strcat "You have selected a " ljg_ent)))
  (setq ljg_ent nil)
  )

 
;; ;;
;; PLINE1 CHECK ;;
;; ;;
(defun ljg_expline1()
(if (= ljg_ent "LWPOLYLINE")
  (progn
    (vl-cmdf "_explode" ljg1_sel1 "")
    (setq ljg1_sel1 (entlast))
    (setq ljg1_sel2 (entget ljg1_sel1))
    )
(ljg_type))
)


;; ;;
;; PLINE2 CHECK ;;
;; ;;
(defun ljg_expline2()
(if (= ljg_ent "LWPOLYLINE")
  (progn
    (vl-cmdf "_explode" ljg2_sel1 "")
    (setq ljg2_sel1 (entlast))
    (setq ljg2_sel2 (entget ljg2_sel1))
    )
(ljg_type))
)

;; ;;
;; remet les variables à NIL ;;
;; ;;
(defun ljgvar2nil()
(setq w nil)
  (setq ljg_ent nil
        ljg1_sel1 nil
ljg1_sel2 nil
ljg1_pt1 nil
ljg1_pt2 nil
ljg2_pt1 nil
ljg2_pt2 nil
dist_f1 nil
dist_f2 nil
dist_f3 nil
dist_f4 nil
spoint nil
epoint nil
pvar nil)
  )

Keep smile...