Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp error: bad argument type: lentityp nil

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
atawk
4344 Views, 3 Replies

lisp error: bad argument type: lentityp nil

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

3 REPLIES 3
Message 2 of 4
ВeekeeCZ
in reply to: atawk

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.

Message 3 of 4
pbejse
in reply to: atawk


@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 ]..

Message 4 of 4
lena.talkhina
in reply to: atawk

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.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost