Author Topic: PLINE JOIN  (Read 6761 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
PLINE JOIN
« on: December 03, 2004, 07:35:01 AM »
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

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
PLINE JOIN
« Reply #1 on: December 03, 2004, 07:53:27 AM »
If you have express tools use pljoin
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
PLINE JOIN
« Reply #2 on: December 03, 2004, 08:05:51 AM »
I have this but never tried it.
Code: [Select]
;;  from Marc'Antonio Alessi (nospam_maalessi_at_tin_dot_it)
; #PlineJoinPrec = global
;
(defun C:ALE_PlJoin (/ SelSet FltLst OldLPr)
 ;(setvar "CMDECHO" 0) ; I have always = 0
  (princ "\nSelect lines, arcs or polylines to join:  ")
  (setq OldLPr (getvar "LUPREC"))  (setvar "LUPREC" 8)
  (setq
    FltLst
    '((0 . "LWPOLYLINE,POLYLINE,LINE,ARC"))
    #PlineJoinPrec
     (ureal 5 "" "Precision distance" (cond ( #PlineJoinPrec ) ( 0.00001 )))
  )
  (setvar "LUPREC" OldLPr)
  (cond
    ( (not (setq SelSet (cond ((ssget "_I" FltLst)) ((ssget FltLst)))))
      (prompt "\nNo arc or polyline selected.  ")
    )
    ( (ssget "_P" '((0 . "LINE,ARC")))
      (command "_.PEDIT" "_M" SelSet "" "_Y" "_J" "_J" "_E" #PlineJoinPrec"")
      (princ (strcat
        "\n" (itoa (sslength SelSet))
        " lines, arcs or polylines are joined.  "
      )       )
    )
    ( T
      (command "_.PEDIT" "_M" SelSet "" "_J" "_J" "_E" #PlineJoinPrec "")
      (princ "\n_ ")
      (princ (strcat "\n " (itoa (sslength SelSet)) " polylines are joined."))
    )
  )
  (princ)
)
;*
;* UREAL  Funzione di interfaccia utente per numeri reali.
;* BIT (0 per nessuno) e KWD key word ("" per nessuna) sono gli stessi di
;* INITGET.
;* MSG e' la stringa di prompt, alla quale e' aggiunto numero reale di default
;* come <DEF> (nil per nessuno), e un : sara' aggiunto.
;*
(defun ureal (bit kwd msg def / inp)
  (if def
    (setq
      msg (strcat "\n" msg " <" (ALE_RTOS_DZ8 def) ">: ")
      bit (* 2 (fix (/ bit 2)))
    )
    (setq msg (strcat "\n" msg ": "))
  )
  (initget bit kwd)
  (setq inp (getreal msg))
  (if inp inp def)
);defun UREAL
;
(defun ALE_RtoS_DZ8 (ReaVal / CurDZn OutVal)
  (if (= 8 (setq CurDZn (getvar "DIMZIN")))
    (setq CurDZn nil)
    (setvar "DIMZIN" 8)
  )
  (setq OutVal (rtos ReaVal 2))
  (and CurDZn (setvar "DIMZIN" CurDZn))
  OutVal
)
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.

SMOKIIBEAR

  • Guest
Re: PLINE JOIN
« Reply #3 on: November 15, 2005, 06:20:04 PM »
HOW CAN THIS ROUTINE BE REWRITTEN SO THAT IT IS NOT NECESSARY TO ENTER FUZZ DISTANCE AT THE COMMAND LINE EACH TIME, BUT THE OPTION COULD BE AVAILABLE?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: PLINE JOIN
« Reply #4 on: November 15, 2005, 06:33:57 PM »
If you have a few dollars and don't want to write you own .... GBPoly [ http://www.geometricad.com/ ] You'll find it hard to beat. :-)
TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
Re: PLINE JOIN
« Reply #5 on: November 16, 2005, 12:22:57 PM »
Here's the one I use...

Code: [Select]
;;
;; 06/22/05
;; Polyline Joins Selected Objects
;;
  (defun c:j (/ ss)
   (prompt "\nSelect Objects to Join... ")
   (setq ss (ssget))
   (command "pedit" "m" ss "" "j" "" "")
   (princ)
  )


deegeecees

  • Guest
Re: PLINE JOIN
« Reply #6 on: November 16, 2005, 12:46:46 PM »
If you have a few dollars and don't want to write you own .... GBPoly [ http://www.geometricad.com/ ] You'll find it hard to beat. :-)


Very good app.

LE

  • Guest
Re: PLINE JOIN
« Reply #7 on: November 16, 2005, 12:54:13 PM »
Yes....

Here is a link to see GBPOLY in action:

http://www.geometricad.com/app.php?id=1&lang=en

There are a lot of open source, samples on how to join plines, lines and arcs, if you are looking for a smart and easy way to generate closed areas, then give GBPOLY a try.

SMOKIIBEAR

  • Guest
Re: PLINE JOIN
« Reply #8 on: November 16, 2005, 02:44:16 PM »
Ahhh...that makes me happy :lmao:

Thanks.  One of these days, I need to starting writing lisp.

whdjr

  • Guest
Re: PLINE JOIN
« Reply #9 on: November 16, 2005, 03:04:28 PM »
How about sooner that later.

Lisp Forum
Lisp Course Documents

Swift

  • Swamp Rat
  • Posts: 596
Re: PLINE JOIN
« Reply #10 on: November 16, 2005, 03:09:11 PM »
How about sooner that later.

Lisp Forum
Lisp Course Documents

Quote
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you

deegeecees

  • Guest
Re: PLINE JOIN
« Reply #11 on: November 16, 2005, 03:16:46 PM »
How about sooner that later.

Lisp Forum
Lisp Course Documents
Quote
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you

Ditto.

whdjr

  • Guest
Re: PLINE JOIN
« Reply #12 on: November 16, 2005, 03:19:13 PM »
I think that was invitation only forum.  You had to sign up for the class.

Maybe Mark can unlock that for everyone?

edit
Sorry 'bout that guys I forgot.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: PLINE JOIN
« Reply #13 on: November 16, 2005, 03:19:24 PM »
I get the same thing .... perhaps when Mark was playing around with the board he got it mal-adjusted ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: PLINE JOIN
« Reply #14 on: November 17, 2005, 02:47:22 AM »
That was a course that was run by Stig. We had to sign up for the course. I believe its only for the students on Stigs course.
T :-)
Thanks for explaining the word "many" to me, it means a lot.

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...