PDA

View Full Version : Convert Line to PLine


slayer913
2006-11-30, 05:31 PM
Hello all -

Anyone have a quick solution to changing Lines into PLines? I would like to select an area with a bounding box, filter out all selected entites that are not lines, and convert the selected lines to Plines.

Any help would be great!

Thanks!

Opie
2006-11-30, 05:33 PM
Hello all -

Anyone have a quick solution to changing Lines into PLines? I would like to select an area with a bounding box, filter out all selected entites that are not lines, and convert the selected lines to Plines.

Any help would be great!

Thanks!
Have you tried the Multiple option of the PEDIT command?

CAB2k
2006-11-30, 05:59 PM
Another hint
(setq ss (ssget "_C" '(0 0) '(1 1)'((0 . "LINE"))))

Lions60
2006-11-30, 06:27 PM
Here is some code that will get all lines in a drawing without user selection and convert them to plines. This takes a step out of the process, but if you are needing the user selection option this code can be modified.


(defun PLINECONVERT (/ OLDVAR1 LCOLOR COUNT LINENO SS1 ENT EDATA PT1 PT2)
(command ".undo" "Mark")
(setq OLDVAR1 (getvar "CMDECHO")) (setvar "CMDECHO" 0)
(setvar "PLINEWID" (getreal "Enter Width for Plines: "))
(setq SS1 nil)
(setq SS1 (ssget "X" ' ((0 . "LINE"))))
(setq LINENO (sslength SS1))
(setq COUNT 0)
(setq PLINFO (ssadd))
(repeat LINENO
(progn
(setq ENT (ssname SS1 COUNT))
(setq EDATA (entget ENT))
(setq PT1 ( cdr (assoc 10 EDATA)))
(setq PT2 ( cdr (assoc 11 EDATA)))
; (setq LCOLOR (cdr (assoc 62 EDATA)))
(setq LLAYER (cdr (assoc 8 EDATA)))
;(if LCOLOR (princ) (setq LCOLOR "BYLAYER"))
(command "Color" LCOLOR )
(command "Layer" "s" LLAYER "")
(command "Pline" PT1 PT2 "")
(ssadd (entlast) PLINFO)
(prompt (strcat "Processing line no. " (itoa COUNT) "\r"))
(setq COUNT (1+ COUNT))
)
)
(COMMAND "ERASE" SS1 "")
(setvar "CMDECHO" OLDVAR1)
(prompt (strcat "\n" "Erasing original lines..." "\n"))
(princ) ; end program
(terpri)
); end convert.lsp

slayer913
2006-12-15, 05:16 PM
Looks like the PEDIT command > Multiple works exactly on the money!

Thanks for the suggestion!

Albert