View Full Version : Selecting, joining multiple Lines into a single Polyline.
tany0070
2007-03-23, 04:12 AM
hi pple, can someone help me check if i made any mistakes in this command call, it sometimes works properly but sometimes it returns a "function cancelled" error. m now stuck and can't do much. pls help, thanks
(defun c:mpline (/ s1)
(setq s1 (ssget "X" '((8 . "outline 1"))))
(command "_pedit" "m" "" s1 "" "y" "" "j" "" "j" "" "e" "" 1234 "" "")
)
RobertB
2007-03-23, 04:33 AM
You do realize that only one pline will be created when you run this routine, regardless of how many different plines are possible from the selection set.
So I modified it a bit. I cannot remember in what version PEditAccept was added, so hopefully you are running a recent version.
(defun c:mpline (/ peditaccept s1)
(setq s1 (ssget "X" '((8 . "0") (0 . "Line,Arc"))))
(setq peditaccept (getvar 'PEditAccept))
(setvar 'PEditAccept 1)
(while (setq s1 (ssget "X" '((8 . "Outline 1") (0 . "Line,Arc"))))
(command "_pedit" s1 "j" s1 "" ""))
(setvar 'PEditAccept peditaccept)
(princ))
tany0070
2007-03-23, 05:22 AM
You do realize that only one pline will be created when you run this routine, regardless of how many different plines are possible from the selection set.
So I modified it a bit. I cannot remember in what version PEditAccept was added, so hopefully you are running a recent version.
(defun c:mpline (/ peditaccept s1)
(setq s1 (ssget "X" '((8 . "0") (0 . "Line,Arc"))))
(setq peditaccept (getvar 'PEditAccept))
(setvar 'PEditAccept 1)
(while (setq s1 (ssget "X" '((8 . "Outline 1") (0 . "Line,Arc"))))
(command "_pedit" s1 "j" s1 "" ""))
(setvar 'PEditAccept peditaccept)
(princ))
sorry i don really quite understand, what i wish to do is to merge a bunch of lines that are connected into 1 polyline. thanks anyways
RobertB
2007-03-24, 01:54 AM
sorry i don really quite understand, what i wish to do is to merge a bunch of lines that are connected into 1 polyline. thanks anyways
That is what my code does.
tany0070
2007-03-26, 03:58 AM
i see thanks you
Tom Beauford
2007-03-26, 08:20 PM
What i wish to do is to merge a bunch of lines that are connected into 1 polyline. I keep peditaccept = 1. Don't like PC assuming I don't know what I'm doing. Macro version: ^C^C^P(ssget);pedit;m;p;;j;0.0;;
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.