rborn Posted November 14, 2008 Share Posted November 14, 2008 I have looked all over for this but can't find it. I want to know if there is a way to determine what the currently selected objects type is in AutoLISP. I don't want to prompt the user to select something, I want to know what the name of currently selected object is. The user selected an object or objects in AutoCAD using whatever method and I want to know what type they are. I am interested in just TEXT objects and will do a comparison for that. Hope that makes sense. Russell Quote Link to comment Share on other sites More sharing options...
lpseifert Posted November 14, 2008 Share Posted November 14, 2008 quick and dirty (defun c:type? (/ typ) (while (setq typ (cdr (assoc 0 (entget (car (entsel)))))) (princ (strcat "\nThe selected entity is a(n) " typ)) ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 14, 2008 Share Posted November 14, 2008 Or for ssget retrieval: (defun c:test (/ ss1 ssl cnt ent1 entyp) (setq ss1 (ssget)) (setq ssl (sslength ss1) cnt 0 ) ; end setq (repeat ssl (setq ent1 (entget (ssname ss1 cnt)) entyp (cdr (assoc 0 ent1)) ) ; end setq (princ (strcat "\n Entity is a(n) " entyp)) (setq cnt (+ cnt 1)) ) (princ) ) Hope this helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.