simple portion of LISP doesnt work in 2017 but did in 2014

simple portion of LISP doesnt work in 2017 but did in 2014

dtiemeyer
Advisor Advisor
727 Views
2 Replies
Message 1 of 3

simple portion of LISP doesnt work in 2017 but did in 2014

dtiemeyer
Advisor
Advisor

I have a lisp routine that does not complete correctly in 2017, but did work ok in 2014.   Basically its just a 'layer command' that does not function inside the routine.  Can anybody think of any environmental factors that may cause this? Either drawing variables or cad system/environment variables?

 

This is the part that does not work (but the command completes, there's no 'hard error):

 

 

(command ".-layer" "f" "e-fire-cvrg-n" "")

 

 

Earlier in the routine, this layer is generated (if it doesnt already exist) by a call to another LSP file, that's the only thing I can think of, but still, it all worked in 2014.

My other CAD is a Cadillac and I like to Revit to the Max!
0 Likes
Accepted solutions (1)
728 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor
Accepted solution

Try to change it with:

 

 (command-s "_.-layer" "_f" "e-fire-cvrg-n" "")

This pice of code work in my AutoCAD 2017 like a charm if e-fire-cvrg-n is not a current layer.

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 3

dtiemeyer
Advisor
Advisor

Thank you Alexander, this did lead me to the solution.  It turns out I had to use the 'command-s' sequence in more than 1 location in the routine, but when I did, it all worked. Cheers.

 

Here's the final working bits (where 'prevlay' is defined earlier in the routine):

 

 

(command-s "_.-layer" "_set" prevlay "") ;Restore previous layer
(command-s "_.-layer" "f" "e-fire-cvrg-n" "")

My other CAD is a Cadillac and I like to Revit to the Max!
0 Likes