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...
|
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...
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
What I use:Work in progress, comments welcomedCode:;;; 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) )
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.
;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
Last edited by aaronic_abacus; 2016-02-18 at 01:14 PM.
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)
Just use eitherorCode:(ssget "X" (list (cons 0 "LINE,ARC")))to get all the lines and arcs in the drawing.Code:(ssget "X" '((0 . "LINE,ARC")))