Autocad 2017 layer toolbar

Autocad 2017 layer toolbar

Mehmet_Demiryurek
Mentor Mentor
2,431 Views
6 Replies
Message 1 of 7

Autocad 2017 layer toolbar

Mehmet_Demiryurek
Mentor
Mentor

I am changing the active layer using Lisp.
The active layer in the Ribbon menu changes but the active layer in the toolbar does not change.
Any command must be entered for the change.
It's not a big problem, but is there a solution?


Mehmet Şamil DEMİRYÜREK

Bu gönderiyi faydalı buldunuz mu? Bu gönderiyi beğenmekten çekinmeyin.
Sorunuz başarıyla yanıtlandı mı? ÇÖZÜMÜ KABUL ET düğmesine tıklayın.


EESignature

Linkedln

0 Likes
Accepted solutions (1)
2,432 Views
6 Replies
Replies (6)
Message 2 of 7

TheCADnoob
Mentor
Mentor

changing the value of a control is not always the same thing as executing a command from the control. Im not familiar enough with the controls/lisp context to make a further distinction but it might be that you are updating the control and not sending the command. 

 

You question may be better fielded in the customization forum https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130

CADnoob

EESignature

0 Likes
Message 3 of 7

Mehmet_Demiryurek
Mentor
Mentor

There is no problem in previous versions
Just got this issue in 2017


Mehmet Şamil DEMİRYÜREK

Bu gönderiyi faydalı buldunuz mu? Bu gönderiyi beğenmekten çekinmeyin.
Sorunuz başarıyla yanıtlandı mı? ÇÖZÜMÜ KABUL ET düğmesine tıklayın.


EESignature

Linkedln

0 Likes
Message 4 of 7

pendean
Community Legend
Community Legend
Are you by chance running a layer filter?
Show us your LISP otherwise, we all have 2017 and my lisp code seems to work just fine in doing what you say yours does.
0 Likes
Message 5 of 7

Mehmet_Demiryurek
Mentor
Mentor

I do not apply any filters.
Simple lisp code. A lisp I have used since Autocad R12.
Habits do not change easily easily 🙂

 

 

Lisp code :

 

(defun c:CR (/ cl_sec cr_katman_ara cl_tek)
 (setvar "cmdecho" 0)
  (setq cr_katman (getvar "clayer"))
  (setq cl_tek nil)
  (while (= cl_tek nil)
    (setq cr_k cr_katman)
    (setq cr_kt(getstring (strcat "\nGüncel Katman Adı:<" cr_katman ">:")))
    (if	(/= cr_kt "")
      (setq cr_katman cr_kt))
    (setq cr_katman_ara (tblsearch "layer" cr_katman))
    (if	(= cr_katman_ara nil)
      (progn
	(alert (strcat "\nKatman tablonuzda [ " cr_katman " ] isimli bir katman yok..."))
	(setq cr_katman cr_k)
	(setq cl_tek nil))
      (progn
	(setq cl_tek "1")
	(if (= cr_kt "")
	  (progn
	    (setq cl_ent (entsel "\nReferans nesneyi seçiniz:"))
	    (if	(= cl_ent nil)
	      (progn)
	      (progn
		(setq cr_katman (cdr (assoc 8 (entget (car cl_ent)))))
	      ))))
	(setq cr_kt cr_katman)
	(setq cr_katman cr_kt)
	(setq cr_kt cr_katman)
      )))
  (setvar "clayer" cr_katman)
  (princ)
)

Mehmet Şamil DEMİRYÜREK

Bu gönderiyi faydalı buldunuz mu? Bu gönderiyi beğenmekten çekinmeyin.
Sorunuz başarıyla yanıtlandı mı? ÇÖZÜMÜ KABUL ET düğmesine tıklayın.


EESignature

Linkedln

0 Likes
Message 6 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

You can try

(command "_.layer" "_set" cr_katman "")

 

instead of the last (setvar "clayer" cr_katman).

Message 7 of 7

Mehmet_Demiryurek
Mentor
Mentor

Thank you for the suggestion.
Lisp is no problem.


Mehmet Şamil DEMİRYÜREK

Bu gönderiyi faydalı buldunuz mu? Bu gönderiyi beğenmekten çekinmeyin.
Sorunuz başarıyla yanıtlandı mı? ÇÖZÜMÜ KABUL ET düğmesine tıklayın.


EESignature

Linkedln

0 Likes