Thanks MP, That was ridiculously quick and easy. I was thinking that I might get a reply tomorrow. So thank you very much.
Much of LISP is, that's why it's such a valuable tool. You're very welcome.
Question about this code or if you know of another. After placing the (vl-load-com) at the beginning as you suggested, it works great for PolyLines that have been created and have been left alone. However, I have Polylines that after creating them, I double-click them and then choose the "Fit" option (or Fit Curve). This routine doesn't work on these types of PolyLines. is that something that could be fixed?
I didn't really look at the code (kinda tired right now) but it appears to have been written for light weight polylines, aka as lwpolylines (ergo the GetLWPolyData function buried in the code). So the "fix" would be to add code to deal with heavy weight polylines (hereafter referred to as normal polylines), and then branch accordingly depending upon what is supplied.
Normal polylines can be created from light polylines, as you noted, when they are splined or ccurve fit. They can also be created natively depending upon the status of the plinetype variable (hint: read up on it).
The very distilled distinction between lightweight and normal polylines is ... normal polylines consist of a head entity, child vertex entities, and a tail (seqend) entity, whereas a lightweight polyline hosts all the data (including vertex data) in one entity.
Light weight polyline dxf data data:
(
(-1 . <Entity name: 7ffff708470>)
(0 . "LWPOLYLINE")
(330 . <Entity name: 7ffff706ec0>)
(5 . "D7")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbPolyline")
(90 . 5)
(70 . 0)
(43 . 0.0)
(38 . 0.0)
(39 . 0.0)
(10 2327.99 1837.07)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(10 2348.73 1854.86)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(10 2383.84 1856.98)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(10 2402.13 1844.9)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(10 2406.87 1828.26)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(210 0.0 0.0 1.0)
)
Notice the 10, 40, 41, 42 and 91 dxf group codes.
Now the same geometry via a normal poyline, and the data stored with each vertex:
(
(-1 . <Entity name: 7ffff7085c0>)
(0 . "POLYLINE")
(330 . <Entity name: 7ffff706ec0>)
(5 . "EC")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDb2dPolyline")
(66 . 1)
(10 0.0 0.0 0.0)
(70 . 0)
(40 . 0.0)
(41 . 0.0)
(210 0.0 0.0 1.0)
(71 . 0)
(72 . 0)
(73 . 0)
(74 . 0)
(75 . 0)
)
(
(-1 . <Entity name: 7ffff7085e0>)
(0 . "VERTEX")
(330 . <Entity name: 7ffff7085c0>)
(5 . "EE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 2327.99 1837.07 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(-1 . <Entity name: 7ffff708600>)
(0 . "VERTEX")
(330 . <Entity name: 7ffff7085c0>)
(5 . "F0")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 2348.73 1854.86 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(-1 . <Entity name: 7ffff708610>)
(0 . "VERTEX")
(330 . <Entity name: 7ffff7085c0>)
(5 . "F1")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 2383.84 1856.98 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(-1 . <Entity name: 7ffff708620>)
(0 . "VERTEX")
(330 . <Entity name: 7ffff7085c0>)
(5 . "F2")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 2402.13 1844.9 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(-1 . <Entity name: 7ffff708630>)
(0 . "VERTEX")
(330 . <Entity name: 7ffff7085c0>)
(5 . "F3")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 2406.87 1828.26 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(-1 . <Entity name: 7ffff7085d0>)
(0 . "SEQEND")
(330 . <Entity name: 7ffff7085c0>)
(5 . "ED")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(-2 . <Entity name: 7ffff7085c0>)
)
That's all I have for now. Hope it. Others will chime in with additional info to augment this. Have fun, and welcome to the swamp.