PDA

View Full Version : How to change LW PolyLines to 2D PolyLines


Lions60
2006-07-24, 04:48 PM
I have code written to change all lines to plines, but they are changing them to LW PLines and i need them to be 2D PLines. If there is a way please help.

Here is the Code

(defun PLINECONVERT (/ OLDVAR1 LCOLOR COUNT LINENO SS1 ENT EDATA PT1 PT2)

(alert "\nConverting lines to PLines\n")

(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


All Help is appreciated.

T.Willey
2006-07-24, 05:06 PM
What is your definition of a 2D pline? An LW pline is a 2D pline. It has one value for the height for all the vertices, and then each vertex is show in only (x,y) format.

Opie
2006-07-24, 05:11 PM
What is your definition of a 2D pline? An LW pline is a 2D pline. It has one value for the height for all the vertices, and then each vertex is show in only (x,y) format.
I think the OP is referring to the older 2D POLYLINE object.

T.Willey
2006-07-24, 05:34 PM
I think the OP is referring to the older 2D POLYLINE object.
If so, then I don't think I can help. When I started to notice the different plines, I noticed that one is an LW pline, and one is a pline, with the reqular pline having vertices represented with (x,y,z).

Opie
2006-07-24, 05:40 PM
The way you are creating the POLYLINEs, you may check into the system variable PLINETYPE. You could change it to 0 (zero).

Lions60
2006-07-24, 06:28 PM
Yes I am talking about the older version of the 2D polyline and I will check the variable to see if that helps. Is there a way to take existing lw plines and change them to the old 2D plines.

T.Willey
2006-07-24, 07:11 PM
There is a command "convert" in 2006, in earlier versions I thought it was "convertpline".

Lions60
2006-07-25, 01:42 PM
Yes, i found an undocumented command in autocad that lets you convert strictly lw plines to heavy-weight plines(2d plines) it is convertpoly.

anssi.wainio
2006-08-15, 03:55 PM
The only reason I can see to change a LW polyline to the older object type is that the vertices of the old-style polyline can be selected and edited with AutoLisp, as they appear as subentities. Is there any way to do this (change a width of a picked segment, for instance) to a LW polyline?

Anssi

ana.135784
2007-07-13, 06:14 PM
Does somebody know to to convert plines onto lw plines?
Thank you

T.Willey
2007-07-13, 07:58 PM
Does somebody know to to convert plines onto lw plines?
Thank you
Same command, convert or convertpoly.