Ahmeds Posted November 21, 2012 Share Posted November 21, 2012 What function should i use to do that? I'm planning to change all entities in one layer but its is hard to select by windowing/crossing method because i have many entities in my drawing, so, i want to just click one but gripped all objects in the same layer to change simultaneously in just one command. Thanks in advance.. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 21, 2012 Share Posted November 21, 2012 QSelect / GetSel Quote Link to comment Share on other sites More sharing options...
Ahmeds Posted November 21, 2012 Author Share Posted November 21, 2012 QSelect / GetSel Thanks Lee, but as I go to Autodesk Help (AutoLisp Functions) to see an example as my reference I've notice that there is no functions such as Getsel. can u please give me an example of that? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 21, 2012 Share Posted November 21, 2012 ........... I've notice that there is no functions such as Getsel. GetSel is a command , and Lee gave you two options so you can use either of them Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 21, 2012 Share Posted November 21, 2012 A third built-in alternative is the FILTER command. The GETSEL command is part of Express pack; for this reason it isn’t listed in AutoCAD’s help. If you cannot call it at command prompt, too, this may be from either the fact that you don’t have that extension installed, or that you are using the LT type of AutoCAD. Quote Link to comment Share on other sites More sharing options...
Ahmeds Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) GetSel is a command , and Lee gave you two options so you can use either of them Ok, I got you guys.. Thanks! I tried this routine to make a selection and change all text heights in just one command but all I've got is error: bad argument type: lselsetp Would you please help me to do this right.. (defun c:CTH () (graphscr) ;(prompt "text height to change")(terpri) (setq a (car (entsel)))(terpri) (if a (setq a (cdr(assoc 8 (entget a))) sslst(list (cons 0 "text")(cons 8 a)) ) );end if (setq nh(getreal "New Text Height: ")) ;(princ "\nWORKING\n") (setq N (sslength sslst)) (progn (setq n1 N) (repeat N (setq n1 (- n1 1)) (setq b (ssname sslst n1)) (setq c (cdr(assoc 0(entget b)))) (if (= c "TEXT") (progn (setq e (entget b)) (setq f (assoc 40 e)) (setq g (atof(rtos(cdr f)2 6))) (entmod (subst(cons(car f) nh) f e)) )) )) (princ) ) Edited December 15, 2012 by Ahmeds Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 21, 2012 Share Posted November 21, 2012 That code attempts to treat a list as a selection set; I believe that this line: sslst (list (cons 0 "text") (cons 8 a)) should be instead: sslst [color=red](ssget "_X" [/color](list (cons 0 "text") (cons 8 a)[color=red])[/color]) Quote Link to comment Share on other sites More sharing options...
Ahmeds Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) well, i got it now.. here it is.. (defun c:CTH () (graphscr) (prompt "text height to change")(terpri) (setq x (car (entsel)))(terpri) (if x (setq x (cdr(assoc 8 (entget x))) sslst(list (cons 0 "text")(cons 8 x)) ) );end if (setq a (ssget "x" sslst)) (setq nh(getreal "New Text Height: ")) (setq N (sslength a)) (progn (setq n1 N) (repeat N (setq n1 (- n1 1)) (setq b (ssname a n1)) (setq c (cdr(assoc 0(entget b)))) (if (= c "TEXT") (progn (setq e (entget b)) (setq f (assoc 40 e)) (setq g (atof(rtos(cdr f)2 6))) (entmod (subst(cons(car f) nh) f e)) )) )) (princ) ) Thank you Guys... Edited December 15, 2012 by Ahmeds Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 21, 2012 Share Posted November 21, 2012 You should localize your variables and include the entire processing in the IF, or at least ensure that exit if user didn't select first text item. Just run your routine twice in a row, and second time do not select a text label, input a text height different than at first run and see what is happening. Also, please edit the above port and add the required code tags. Thank you. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 21, 2012 Share Posted November 21, 2012 Pay attention to locked layers with the selection method "_x" Quote Link to comment Share on other sites More sharing options...
Ahmeds Posted November 21, 2012 Author Share Posted November 21, 2012 Pay attention to locked layers with the selection method "_x" Thank you.. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 21, 2012 Share Posted November 21, 2012 Thank you.. You're welcome Don't forget to modify your post number 8# with Code Posting tags . Quote Link to comment Share on other sites More sharing options...
Ahmeds Posted November 21, 2012 Author Share Posted November 21, 2012 You're welcome Don't forget to modify your post number 8# with Code Posting tags . Oppss, Sorry, Just a newbie.. I don't know how was it.. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 21, 2012 Share Posted November 21, 2012 Welcome to CADTutor Ahmeds! You need to read the CODE POSTING GUIDELINES and add CODE tags to the code in post #8 and change the CODE in post #6 from QUOTE tags to CODE tags. Select "Go Advanced" at lower right of the edit box. 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.