Can anyone help why i'm getting this error when running the attached lisp (test.lsp) though the lisp is working fine.
lisp error: bad argument type: lentityp nil
Solved! Go to Solution.
Can anyone help why i'm getting this error when running the attached lisp (test.lsp) though the lisp is working fine.
lisp error: bad argument type: lentityp nil
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
That is your code?
The code looks fine (but misplaced (princ) which is a minor detail..)
The only issue is bad logic. You cannot run the repeat on the entire sset when you connect 2 items of the same sset...
The number of items is 1+ number of connections... unless you want to connect the last item with the first one too.
That is your code?
The code looks fine (but misplaced (princ) which is a minor detail..)
The only issue is bad logic. You cannot run the repeat on the entire sset when you connect 2 items of the same sset...
The number of items is 1+ number of connections... unless you want to connect the last item with the first one too.
@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 ]..
@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 ]..
Welcome to Autodesk Community @atawk !
So happy you already found your first solution!
Don't hesitate to ask any question by creating a new thread
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
Welcome to Autodesk Community @atawk !
So happy you already found your first solution!
Don't hesitate to ask any question by creating a new thread
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
Can't find what you're looking for? Ask the community or share your knowledge.