samifox Posted November 17, 2015 Share Posted November 17, 2015 hi trying to say "select only line and all kind of polyline" get wrong result (defun c:demo (/ ent flag sel) (setq flag t) (while flag (if (setq ent(car(entsel "Select object"))) (progn (setq ent (entget ent)) (setq flag nil) (if (or (= (cdr(assoc 0 ent)) "LINE" )(= (cdr(assoc 0 ent)) "*POLYLINE")) (alert "a supported entity were selected") (alert "a unsupported entity were selected") ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted November 17, 2015 Share Posted November 17, 2015 why not use (ssget) ? Quote Link to comment Share on other sites More sharing options...
samifox Posted November 17, 2015 Author Share Posted November 17, 2015 why not use (ssget) ? how would i add a select prompt to ssget? (ssget "_A" '((0 . "LINE"))) Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 17, 2015 Share Posted November 17, 2015 Try to change (or (= (cdr(assoc 0 ent)) "LINE" )(= (cdr(assoc 0 ent)) "*POLYLINE")) ;to (wcmatch (cdr (assoc 0 ent)) "LINE,*POLYLINE") Henrique Quote Link to comment Share on other sites More sharing options...
samifox Posted November 17, 2015 Author Share Posted November 17, 2015 Thanks hanreqe Quote Link to comment Share on other sites More sharing options...
David Bethel Posted November 17, 2015 Share Posted November 17, 2015 how would i add a select prompt to ssget? (ssget "_A" '((0 . "LINE"))) (ssget) automatically prompts to 'Select objects: ' Quote Link to comment Share on other sites More sharing options...
samifox Posted November 17, 2015 Author Share Posted November 17, 2015 Does it?. How would you do the same with ssget? Quote Link to comment Share on other sites More sharing options...
samifox Posted November 17, 2015 Author Share Posted November 17, 2015 AFAIK only ssget with no args or X is giving a prompt....all the rest operating with no live interaction. Quote Link to comment Share on other sites More sharing options...
broncos15 Posted November 17, 2015 Share Posted November 17, 2015 Does it?. How would you do the same with ssget? If you just want the user to select one object and act like the entsel then it would be like this: (setq ss (ssget "_+.:E:S" '((0 . "LINE,POLYLINE,LWPOLYLINE")))) If you want the user to be able to select multiple objects then: (setq ss (ssget '((0 . "LINE,POLYLINE,LWPOLYLINE")))) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted November 17, 2015 Share Posted November 17, 2015 (ssget) prompts if there are no automated options. Automated options include "X" "CP" "WP" Quote Link to comment Share on other sites More sharing options...
samifox Posted November 20, 2015 Author Share Posted November 20, 2015 how would i add a select prompt to ssget? (ssget "_A" '((0 . "LINE"))) using ssget instead of entsel saves lots of code. thanx Quote Link to comment Share on other sites More sharing options...
samifox Posted November 20, 2015 Author Share Posted November 20, 2015 If you just want the user to select one object and act like the entsel then it would be like this: (setq ss (ssget "_+.:E:S" '((0 . "LINE,POLYLINE,LWPOLYLINE")))) If you want the user to be able to select multiple objects then: (setq ss (ssget '((0 . "LINE,POLYLINE,LWPOLYLINE")))) very usefull. thanx Quote Link to comment Share on other sites More sharing options...
3dwannab Posted April 7, 2017 Share Posted April 7, 2017 (edited) You can do this with this: ;; by user gile here: ;; https://www.theswamp.org/index.php?PHPSESSID=amuofcfnqe6mf8r4g8n5j4t4h4&topic=34004.msg393324#msg393324 (defun fentsel (msg fltr / ent) (if (and (setq ent (if (and (= (type msg) 'STR) (/= msg "")) (entsel msg) (entsel) ) ) (wcmatch (cdr (assoc 0 (entget (car ent)))) (strcase fltr)) ) ent ) ) Then: (car (fentsel (strcat"\nSelect your Text :\n") "TEXT,MTEXT")) Or to prevent the pick from any miss hits by the user (This keeps asking for the object until it's picked) : (while (not (setq ent (car (fentsel (strcat"\nSelect Polyline to offset :\n") "*POLYLINE,LINE")) ))) Edited June 25, 2022 by 3dwannab additional miss hit code 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.