@atawk wrote:
lisp error: bad argument type: lentityp nil
(setq N (sslength sset))
TO
(1- (setq N (sslength sset)))
5 objects selected, that makes 1-2 [ 1 ] 2-3 [ 2 ] 3-4 [ 3 ] 4-5 [ 4 ] <----
Like @ВeekeeCZ said , unless you want to connect the last to the first one. You need to approach it some other way.
HTH
EDIT: curious though, be aware that the code depends on the order of selection, which means if you select by window, there could be some issues which blocks connect to what, [ order of creation plays a big role here ].
Now , on your code, if you decide to select one by one, the last selection wil the the first to be process.
If you are sticking with individual selection, might as well use while function, to connect every selection at once.
Just something to think about.
or better yet.
command: pline... pick [ ins ]..