See the top rated post in this thread. Click here

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

Thread: convert close entity of number of line and arc into single polyline by single click

  1. #1
    Member
    Join Date
    2015-09
    Posts
    11
    Login to Give a bone
    0

    Default convert close entity of number of line and arc into single polyline by single click

    i want to covert close entity of line and arc into single polyline without selecting line or arc.
    also i have more than 1 close entity of line and arc so i required convert all close entity into polyline.
    help regards this..


    thanks in advance...

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Use the PEDIT command with the Multiple option with a gap tolerance larger than the largest gap.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2015-09
    Posts
    11
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Quote Originally Posted by Opie View Post
    Use the PEDIT command with the Multiple option with a gap tolerance larger than the largest gap.
    please give me the example of this coding i am new in autolisp..

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    What I use:
    Code:
    ;;; PLJOIN.LSP 2015 Version
    ;;; Joins lines, arcs and polylines then resets overkill defaults & combines co-linear polyline segments
    ;;; If only one object is selected it joins to all conected objects
    ;;; If multiple objects are selected it joins just those objects.
    ;;; By Tom Beauford
    ;;; BeaufordT@LeonCountyFL.gov
    ;;; Macro   ^P(or C:pljoin (load "pljoin.lsp"));pljoin
    
    (defun c:pljoin (/ cmdecho peditaccept ss fuzzdst registry)
      (princ "\nSelect object to join: ")
      (setq cmdecho (getvar "cmdecho")
            peditaccept (getvar "peditaccept")
            ss (ssget '((0 . "LINE,ARC,*POLYLINE")))
            registry (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\Overkill")
    ;        fuzzdst (getdist "\nFuzz Distance: ")
      )
      (setvar "cmdecho" 0)
      (setvar "peditaccept" 1)
      (if ss
          (progn
    	(command ".UNDO" "BEgin")
    	(vl-registry-write registry "CombineEndToEnd" "1")
    	(vl-registry-write registry "CombinePartialOverlaps" "1")
    	(vl-registry-write registry "Ignore" "0")
    	(vl-registry-write registry "IgnorePolylineWidths" "0")
    	(vl-registry-write registry "MaintainAssociativities" "1")
    	(vl-registry-write registry "MaintainPolylines" "0")
    	(vl-registry-write registry "OptimizePolylines" "1")
    	(vl-registry-write registry "Tolerance" "0.000001")
    	(if (= (sslength ss) 1)
              (command "_.pedit" ss "_J" "_all" "" "" "-overkill" "L" "" "")
    ;          (command "_.pedit" ss "_J" "_all" "" "")
    ;          (command "_.pedit" "_M" ss "" "_J" "_J" "_E" fuzzdst "")
              (command "_.pedit" "_M" ss "" "_J" "_J" "_E" "0.0" "" "-overkill" "L" "" "")
    ;          (command "_.pedit" "_M" ss "" "_J" "_J" "_E" "0.0" "" "-overkill" "L" "" "")
    	)
          (command "._UNDO" "_End")
          )
      )
      (setvar "cmdecho" cmdecho)
      (setvar "peditaccept" peditaccept)
      (princ)
    )
    Work in progress, comments welcomed
    Last edited by Tom Beauford; 2016-02-12 at 09:12 PM. Reason: Modified registry value again to hopefully work with all profiles and verticals.

  5. #5
    Member
    Join Date
    2015-09
    Posts
    11
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Quote Originally Posted by Tom Beauford View Post
    What I use:
    Code:
    ;;; PLJOIN.LSP 2015 Version
    ;;; Joins lines, arcs and polylines then resets overkill defaults & combines co-linear polyline segments
    ;;; If only one object is selected it joins to all conected objects
    ;;; If multiple objects are selected it joins just those objects.
    ;;; By Tom Beauford
    ;;; BeaufordT@LeonCountyFL.gov
    ;;; Macro   ^P(or C:pljoin (load "pljoin.lsp"));pljoin
    
    (defun c:pljoin (/ cmdecho peditaccept ss fuzzdst registry)
      (princ "\nSelect object to join: ")
      (setq cmdecho (getvar "cmdecho")
            peditaccept (getvar "peditaccept")
            ss (ssget '((0 . "LINE,ARC,*POLYLINE")))
            registry (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\Overkill")
    ;        fuzzdst (getdist "\nFuzz Distance: ")
      )
      (setvar "cmdecho" 0)
      (setvar "peditaccept" 1)
      (if ss
          (progn
    	(command ".UNDO" "BEgin")
    	(vl-registry-write registry "CombineEndToEnd" "1")
    	(vl-registry-write registry "CombinePartialOverlaps" "1")
    	(vl-registry-write registry "Ignore" "0")
    	(vl-registry-write registry "IgnorePolylineWidths" "0")
    	(vl-registry-write registry "MaintainAssociativities" "1")
    	(vl-registry-write registry "MaintainPolylines" "0")
    	(vl-registry-write registry "OptimizePolylines" "1")
    	(vl-registry-write registry "Tolerance" "0.000001")
    	(if (= (sslength ss) 1)
              (command "_.pedit" ss "_J" "_all" "" "" "-overkill" "L" "" "")
    ;          (command "_.pedit" ss "_J" "_all" "" "")
    ;          (command "_.pedit" "_M" ss "" "_J" "_J" "_E" fuzzdst "")
              (command "_.pedit" "_M" ss "" "_J" "_J" "_E" "0.0" "" "-overkill" "L" "" "")
    ;          (command "_.pedit" "_M" ss "" "_J" "_J" "_E" "0.0" "" "-overkill" "L" "" "")
    	)
          (command "._UNDO" "_End")
          )
      )
      (setvar "cmdecho" cmdecho)
      (setvar "peditaccept" peditaccept)
      (princ)
    )
    Work in progress, comments welcomed
    sir, in this program i have to select atleast one line to convert all connected line and arc into polyline.
    but sir, i want to convert them into polyline without selecting any line so what changes i do in this program or any other program for that case...

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Quote Originally Posted by gothinitin019709968 View Post
    sir, in this program i have to select atleast one line to convert all connected line and arc into polyline.
    but sir, i want to convert them into polyline without selecting any line so what changes i do in this program or any other program for that case...
    You can select all or even visible on screen, but I don't know of a way to modify a group of lines without selecting them somehow.

  7. #7
    Member
    Join Date
    2015-09
    Posts
    11
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Quote Originally Posted by Tom Beauford View Post
    You can select all or even visible on screen, but I don't know of a way to modify a group of lines without selecting them somehow.
    ok sir.
    thank u...

  8. #8
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    ;Here's some code I wrote before PLJOIN existed.


    Code:
    (DEFUN C:GPJ (/ PT1 PT2 SSET SSETN PLN LP ENT LA PLN2 TFC CV ENTL EVS SV EVT VE1 VE2 SI1 SI2 SII1 SII2 SI SII PF FB FE FLTR)
    (PROMPT "*GROUP POLYLINE JOIN*")
    (SETQ SSET (SSGET '((0 . "LWPOLYLINE"))))
    (SETQ SSETN (SSLENGTH SSET))
    (SETQ PLN SSETN)
    (PRINT SSETN)
    (PROMPT " POLOYLINES SELECTED")
    (SETQ SSETN (- SSETN 1))
    (SETQ LOOP 1)
    (WHILE LOOP
    (SETQ ENT (SSNAME SSET SSETN))
    (SETQ LA (ASSOC 8 (ENTGET ENT)))
    (SETQ ENTL (ENTGET ENT))
    (SETQ VE1 (CDR(ASSOC 10 ENTL)))
    (SETQ EVS VE1)  
    (SETQ SV 1)
    (WHILE SV   
    (SETQ ENTL  (CDR ENTL))
    (SETQ EVT (ASSOC 10 ENTL))
    (IF (/= EVT NIL) (SETQ VE2 (CDR EVT)) (SETQ SV NIL))
    );END WHILE SV 
    (SETQ SI1 (MAPCAR '+ '( 0.1 0.1 0.0) VE1))
    (SETQ SI2 (MAPCAR '+ '( -0.1 -0.1 0.0) VE1))
    (SETQ SII1 (MAPCAR '+ '( 0.1 0.1 0.0) VE2))
    (SETQ SII2 (MAPCAR '+ '( -0.1 -0.1 0.0) VE2))
    (SETQ PF '(0 . "LWPOLYLINE"))
    (SETQ FB '(-4 . "<AND"))
    (SETQ FE '(-4 . "AND>"))
    (SETQ FLTR (LIST FB PF LA FE))
    (SETQ SI (SSGET "C" SI1 SI2 FLTR)) 
    (SETQ SII (SSGET "C" SII1 SII2 FLTR)) 
    (IF (= SI NIL) (SETQ SI ENT))
    (IF (= SII NIL) (SETQ SII ENT))
    (SETQ CV (CDR (ASSOC 70 (ENTGET ENT))))
    (IF (> CV 0) (SETQ TFC 1) (SETQ TFC 0))
    (IF (= TFC 0) (COMMAND "PEDIT" ENT "J" SI SII "" "X"))
    (SETQ LP 1)
    (WHILE LP
    (SETQ SSETN (- SSETN 1))
    (PROMPT "\nJOIN ATEMPT # ")
    (PRINC SSETN)
    (IF (/= (SSNAME SSET SSETN) NIL) (SETQ NT (ENTGET (SSNAME SSET SSETN))) (SETQ NT 1))
    (IF (= NT NIL) (SETQ LP 1) (SETQ LP NIL))
    (IF (< SSETN 0) (SETQ LOOP NIL))
    );END WHILE LP
    );END WHILE LOOP
    (SETQ SSET NIL)
    (SETQ SSET NIL)
    (PRINC)
    );END JPL
    Attached Files Attached Files
    Last edited by aaronic_abacus; 2016-02-18 at 01:14 PM.

  9. #9
    Member
    Join Date
    2015-09
    Posts
    11
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Quote Originally Posted by Tom Beauford View Post
    You can select all or even visible on screen, but I don't know of a way to modify a group of lines without selecting them somehow.
    Quote Originally Posted by aaronic_abacus View Post
    ;Here's some code I wrote before PLJOIN existed.


    Code:
    (DEFUN C:GPJ (/ PT1 PT2 SSET SSETN PLN LP ENT LA PLN2 TFC CV ENTL EVS SV EVT VE1 VE2 SI1 SI2 SII1 SII2 SI SII PF FB FE FLTR)
    (PROMPT "*GROUP POLYLINE JOIN*")
    (SETQ SSET (SSGET '((0 . "LWPOLYLINE"))))
    (SETQ SSETN (SSLENGTH SSET))
    (SETQ PLN SSETN)
    (PRINT SSETN)
    (PROMPT " POLOYLINES SELECTED")
    (SETQ SSETN (- SSETN 1))
    (SETQ LOOP 1)
    (WHILE LOOP
    (SETQ ENT (SSNAME SSET SSETN))
    (SETQ LA (ASSOC 8 (ENTGET ENT)))
    (SETQ ENTL (ENTGET ENT))
    (SETQ VE1 (CDR(ASSOC 10 ENTL)))
    (SETQ EVS VE1)  
    (SETQ SV 1)
    (WHILE SV   
    (SETQ ENTL  (CDR ENTL))
    (SETQ EVT (ASSOC 10 ENTL))
    (IF (/= EVT NIL) (SETQ VE2 (CDR EVT)) (SETQ SV NIL))
    );END WHILE SV 
    (SETQ SI1 (MAPCAR '+ '( 0.1 0.1 0.0) VE1))
    (SETQ SI2 (MAPCAR '+ '( -0.1 -0.1 0.0) VE1))
    (SETQ SII1 (MAPCAR '+ '( 0.1 0.1 0.0) VE2))
    (SETQ SII2 (MAPCAR '+ '( -0.1 -0.1 0.0) VE2))
    (SETQ PF '(0 . "LWPOLYLINE"))
    (SETQ FB '(-4 . "<AND"))
    (SETQ FE '(-4 . "AND>"))
    (SETQ FLTR (LIST FB PF LA FE))
    (SETQ SI (SSGET "C" SI1 SI2 FLTR)) 
    (SETQ SII (SSGET "C" SII1 SII2 FLTR)) 
    (IF (= SI NIL) (SETQ SI ENT))
    (IF (= SII NIL) (SETQ SII ENT))
    (SETQ CV (CDR (ASSOC 70 (ENTGET ENT))))
    (IF (> CV 0) (SETQ TFC 1) (SETQ TFC 0))
    (IF (= TFC 0) (COMMAND "PEDIT" ENT "J" SI SII "" "X"))
    (SETQ LP 1)
    (WHILE LP
    (SETQ SSETN (- SSETN 1))
    (PROMPT "\nJOIN ATEMPT # ")
    (PRINC SSETN)
    (IF (/= (SSNAME SSET SSETN) NIL) (SETQ NT (ENTGET (SSNAME SSET SSETN))) (SETQ NT 1))
    (IF (= NT NIL) (SETQ LP 1) (SETQ LP NIL))
    (IF (< SSETN 0) (SETQ LOOP NIL))
    );END WHILE LP
    );END WHILE LOOP
    (SETQ SSET NIL)
    (SETQ SSET NIL)
    (PRINC)
    );END JPL
    sir i am using this code for convert line and arc into single polyline without selecting any line or arc.
    but problem is that when i draw close entity of line and arc than it is converted to single polyline, but i have one region and i am expload this region to convert into line and arc and than i use this code than it is not covert into single polyline but it's convert different polyline for line and arc.

    (setq ss23 (ssget "X" (list (cons 0 "LINE")))) ;;filter for the LINES selection
    (setq ss33 (ssget "X" (list (cons 0 "ARC")))) ;;filter for the ARCS selection


    (setq varlist (list "cmdecho" "peditaccept")
    oldvars (mapcar 'getvar varlist)
    ) ;_ end setq




    (mapcar 'setvar varlist (list 0 1))

    ;;;; if both the lines and arcs exist

    (if (and (/= ss23 nil) (/= ss33 nil));check if there are any LINES of that name
    (progn
    (vl-cmdf "_pedit" "_M" ss23 ss33 "" "J" "0" "")
    )
    (princ)
    )




    ;;;; if only lines exist

    (if (and (/= ss23 nil) (= ss33 nil));check if there are any LINES of that name
    (progn
    (vl-cmdf "_pedit" "_M" ss23 "" "J" "0" "")
    )
    (princ)
    )



    ;;;; if only arcs exist

    (if (and (= ss23 nil) (/= ss33 nil));check if there are any LINES of that name
    (progn
    (vl-cmdf "_pedit" "_M" ss33 "" "J" "0" "")
    )
    (princ)
    )



    (mapcar 'setvar varlist oldvars)
    (princ)

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: convert close entity of number of line and arc into single polyline by single click

    Just use either
    Code:
    (ssget "X" (list (cons 0 "LINE,ARC")))
    or
    Code:
    (ssget "X" '((0 . "LINE,ARC")))
    to get all the lines and arcs in the drawing.

Page 1 of 2 12 LastLast

Similar Threads

  1. Double Click a Line to Convert it to a Polyline
    By zoomharis in forum AutoCAD Tips & Tricks
    Replies: 23
    Last Post: 2016-05-29, 09:21 PM
  2. line cannot be selected by single left click
    By jacek.brzezowski in forum Revit - Platform
    Replies: 1
    Last Post: 2008-09-25, 12:13 PM
  3. Convert a multi-line to a single line
    By Richard McDonald in forum AutoCAD General
    Replies: 7
    Last Post: 2007-05-09, 04:32 PM
  4. Single mouse click to edit single line text
    By cjshaw in forum AutoCAD LT - General
    Replies: 5
    Last Post: 2007-02-14, 04:59 PM
  5. Single line to polyline converstion programs
    By sgeelmuyden in forum Software
    Replies: 7
    Last Post: 2005-11-21, 10:13 AM

Tags for this Thread

Posting Permissions

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