Tripledot Posted June 13, 2016 Share Posted June 13, 2016 (edited) Been using this "select in cross box" lisp by Tharwat & is good. But I have 2 request. 1. Please allow to able to select multiple box 2. After selecting everything in the multiple cross box, exclude the box from the selection (defun c:SIB (/ s ss sel) ;; Tharwat 30. May. 2014 ;; (if (setq s (ssadd) ss (ssget (list '(0 . "LWPOLYLINE") '(-4 . "&=") '(70 . 1) (cons 410 (getvar 'CTAB)) ) ) ) ((lambda (j / sn n d l pts) (while (setq sn (ssname ss (setq j (1+ j)))) (setq l (vlax-curve-getdistatparam sn (vlax-curve-getendparam sn)) d (/ l 250.) n d pts nil ) (repeat 250 (setq pts (cons (vlax-curve-getpointatdist sn n) pts) n (+ n d) ) ) (if (setq sel (ssget "_CP" pts)) ((lambda (i / en) (while (setq en (ssname sel (setq i (1+ i)))) (ssadd en s) ) ) -1 ) ) ) ) -1 ) ) (sssetfirst nil s) (princ) ) Edited June 13, 2016 by Tripledot Quote Link to comment Share on other sites More sharing options...
SLW210 Posted June 13, 2016 Share Posted June 13, 2016 You need to use Code Tags instead of Quote Tags for your Code. [NOPARSE] Your Code Here [/NOPARSE]= Your Code Here Quote Link to comment Share on other sites More sharing options...
Tripledot Posted June 13, 2016 Author Share Posted June 13, 2016 (edited) You need to use Code Tags instead of Quote Tags for your Code. [NOPARSE]Your Code Here [/NOPARSE]= Your Code Here My mistake. Updated. Edited June 14, 2016 by Tripledot Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 14, 2016 Share Posted June 14, 2016 Hi, The program asks you to select closed lwpolylines so what do you mean by the following question? 1. Please allow to able to select multiple box For the second question just replace this line (ssadd en s) with the following : (if (not (eq sn en)) (ssadd en s) ) Quote Link to comment Share on other sites More sharing options...
Tripledot Posted June 14, 2016 Author Share Posted June 14, 2016 Hi, The program asks you to select closed lwpolylines so what do you mean by the following question? For the second question just replace this line (ssadd en s) with the following : (if (not (eq sn en)) (ssadd en s) ) Thanks Tharwat. That change worked. Also i forgotten that it can select multiple boxes so can ignore the 1st question. Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 14, 2016 Share Posted June 14, 2016 You are welcome. Quote Link to comment Share on other sites More sharing options...
Tripledot Posted June 15, 2016 Author Share Posted June 15, 2016 Tharwat. I encounter an issue. It can only select with I am in WORLD UCS. Can make it possible to select in other UCS? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 15, 2016 Share Posted June 15, 2016 Tharwat. I encounter an issue. It can only select with I am in WORLD UCS. Can make it possible to select in other UCS? Replace the following: (setq pts (cons (trans (vlax-curve-getpointatdist sn n) 1 0) pts) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 15, 2016 Share Posted June 15, 2016 I think it would need to be: (trans 0 1) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 15, 2016 Share Posted June 15, 2016 I think it would need to be:(trans < ... > 0 1) Opps. I should not have replied that fast which cause that big mistake to occur. Quote Link to comment Share on other sites More sharing options...
Tripledot Posted June 16, 2016 Author Share Posted June 16, 2016 (edited) Opps. I should not have replied that fast which cause that big mistake to occur. no issue Tharwat. Only got the chance to test it just. Too be sure, this would be the code? (setq pts (cons (trans (vlax-curve-getpointatdist sn n) 0 1) pts) Edited June 16, 2016 by Tripledot Quote Link to comment Share on other sites More sharing options...
Tripledot Posted June 16, 2016 Author Share Posted June 16, 2016 Edit I just realise that Lee posted the correction. Though both post were by Tharwat. Hence I got confused. Thanks Lee & Tharwat for the help. Working now. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 16, 2016 Share Posted June 16, 2016 Good for you. Quote Link to comment Share on other sites More sharing options...
Tripledot Posted August 11, 2016 Author Share Posted August 11, 2016 Hi Tharwat. I now face an issue. I need to select those items not crossing or touching the selected polyline but only those that are completely inside. Can you advise on the code to only select entities completely inside the selected closed polyline? Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 11, 2016 Share Posted August 11, 2016 Hi, Just replace "_CP" with "_WP" in the following codes; (ssget "_CP" pts) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 11, 2016 Share Posted August 11, 2016 There is lots of ssget options a couple CP crossing polygon WP within polygon W a window of two points F a fence or like a pline crossing objects 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.