Polylines Joining For No Reason

Polylines Joining For No Reason

mgorecki
Collaborator Collaborator
1,020 Views
20 Replies
Message 1 of 21

Polylines Joining For No Reason

mgorecki
Collaborator
Collaborator

I have never run into this before, so I'm at a loss for why it's happening.  I'm using AutoCad 2018 Vanilla in Windows.

My code adds lwpolylines on a layer at a certain width (50.0).  It's like a grid with horizontal and vertical lwpolylines.

Then it turns off that layer and turns on, and sets, another layer.  It creates more lwpolylines with a different width (280) at the exact same coordinates.

When it's done running, the lwpolylines on the first layer are gone.  When I check the lwpolylines on the second layer, they have both widths.

This is a listing of one of the lwpolylines:

LWPOLYLINE Layer: "SOLDERMASK_BOTTOM"
Space: Model space
Handle = 1a21e
Closed
area 0.0000
perimeter 113600.0000

at point X=-35500.0000 Y=28400.0000 Z= 0.0000
starting width 50.0000
ending width 50.0000
at point X=-35500.0000 Y=-28400.0000 Z= 0.0000
starting width 280.0000
ending width 280.0000

 

This is the code used to create the lwpolylines:

(defun CreateLWPoly (plPntList plWidth openORclose)
 (entmake (append (list (cons 0 "LWPOLYLINE")
                        (cons 100 "AcDbEntity")
                        (cons 100 "AcDbPolyline")
                        (cons 90 (length plPntList))
                        (cons 70 openORclose) ;closed(1) or open(0)
                        (cons 43 plWidth)
                  )
                  (mapcar (function (lambda (p) (cons 10 p))) plPntList)
           )
 )
)

 

If anyone has an idea why this happens, I'd appreciate it if you let me know.  Thanks.

 

0 Likes
1,021 Views
20 Replies
Replies (20)
Message 21 of 21

Sea-Haven
Mentor
Mentor

A 2D lwpolyline has a Elevation setting ie Z (38 . 0.0) so could add that maybe at like 1000.0

 

The other suggestion is maybe do a regen every 100 etc. 

 

 

0 Likes