i want select object in model space

i want select object in model space

jaimuthu
Advocate Advocate
528 Views
3 Replies
Message 1 of 4

i want select object in model space

jaimuthu
Advocate
Advocate

its possible i select object and get layer name in msgbox

0 Likes
Accepted solutions (1)
529 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

That would be an easy thing to write a routine to do, but with one object selected [or multiple objects if they're all on the same Layer] the Layer panel in the ribbon shows you directly:

Kent1Cooper_0-1711400805232.png

Does that not tell you what you want to know?  I keep the Properties palette up all the time, narrowed down along one side of the screen, and it also shows the Layer of what is selected [again, when more than one object, if they are all on the same Layer].

Kent Cooper, AIA
0 Likes
Message 3 of 4

devitg
Advisor
Advisor

@jaimuthu  

 

 test it 

 

(setq ent (car (entsel "\n Pick the Obj" )))
(setq ent-name (Cdr (assoc 0 (entget ent))))
 (setq ent-layer (Cdr (assoc 8 (entget ent))))     
  (alert (strcat "\n the object is a: "  ent-name "\n on layer" ent-layer))

 

0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

@jaimuthu wrote:

.... i select object and get layer name in msgbox


In very simplest terms, if literally just that much will do:

(alert (cdr (assoc 8 (entget (car (entsel))))))

You can just paste that in at the command line, or put just that into a Tool Palette button, or with a little bit of additional code, define it into a command name that you can type in.

 

Kent Cooper, AIA
0 Likes