Dadgad Posted September 12, 2012 Share Posted September 12, 2012 I tried earlier too, and reported the invalid link to the administrator. Emily perhaps you could try to repost your drawing? Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 12, 2012 Share Posted September 12, 2012 Shows up for me. I'll repost. [ATTACH=CONFIG]37095[/ATTACH] Quote Link to comment Share on other sites More sharing options...
Emily_83 Posted September 13, 2012 Author Share Posted September 13, 2012 Hi guys, sorry the image didn't work, i have attached an example drawing of what i need, i have outlined what i need within the drawing, i really hope i haven't over explained and confused you when you take a look, but sometimes more info is better that less. please note that there were one or 2 lengths i didn't provide you with earlier which i think was 1.0 and 2.5, and i just added those lengths into the lisp myself. once again i really appreciate your time and help you have provided. kind regards Emily example.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 13, 2012 Share Posted September 13, 2012 Try this .... (defun c:Test (/ *error* dim ss i sn l) (vl-load-com) (defun *error* (x) (if dim (setvar 'dimzin dim) ) (princ "\n *Cancel*") ) (setq dim (getvar 'dimzin)) (setvar 'dimzin 0) (if (setq ss (ssget "_:L" '((0 . "LINE,*POLYLINE")))) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i)))) (if (eq (cdr (assoc 0 (entget sn))) "LINE") (setq l (distance (cdr (assoc 10 (entget sn))) (cdr (assoc 11 (entget sn))))) (setq l (vlax-curve-getdistatparam sn (fix (vlax-curve-getendparam sn)))) ) (if (member (rtos l 2 2) '("0.50" "1.25" "1.50" "3.00")) (entdel sn) ) ) ) (setvar 'dimzin dim) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 13, 2012 Share Posted September 13, 2012 Hi Emily, Simply change the tolerance in my code from 1e-8 to say, 1e-3 (0.001); the polylines in your file aren't exactly 1.25, 3.0 etc in length, but rather 1.25001. @Tharwat, consider the equal function Lee Quote Link to comment Share on other sites More sharing options...
Emily_83 Posted September 13, 2012 Author Share Posted September 13, 2012 You guys are the best! Tharwat, your lisp worked, it erased some horizontal lines also, and i tried to edit the lisp to stop that from happening but from my limited knowledge i wasn't successful. ...would love to know for future what to edit, i thought it was something in the rtos 1 2 2 part Lee Mac, yours did the same but when you told me to change the 1e-8 to 1e-3, i changed it again to 1e-4 and it worked perfectly, Once again thankyou so much for your help and time, it's saved me going through each longsection and doing it manually. Cheers Emily:D Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 13, 2012 Share Posted September 13, 2012 yours did the same but when you told me to change the 1e-8 to 1e-3, i changed it again to 1e-4 and it worked perfectly It sounds as though much of your geometry is of very similar length since my suggestion of a tolerance of 1e-3 (0.001) and your use of 1e-4 (0.0001) was the difference between various objects being erased - though, I see that you appear to have understood the purpose of the tolerance figure in the code, and am glad you could tweak the program to your needs! Thank you for your gratitude and appreciation Emily! Quote Link to comment Share on other sites More sharing options...
issammesk Posted September 4, 2014 Share Posted September 4, 2014 thank sir but i want first to ask me which length you want to erase so example i enter 30 so outmatically erase all line have same length thanks sir Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 4, 2014 Share Posted September 4, 2014 thank sirbut i want first to ask me which length you want to erase so example i enter 30 so outmatically erase all line have same length thanks sir Try this . (defun c:Test (/ ss i sn l) (if (and (setq l (getdist "\n Specify length :")) (setq ss (ssget "_X" '((0 . "LINE,*POLYLINE"))))) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i)))) (if (equal l (vlax-curve-getdistatpoint sn (vlax-curve-getendpoint sn)) 1e- (entdel sn) ) ) ) (princ) )(vl-load-com) Quote Link to comment Share on other sites More sharing options...
issammesk Posted September 4, 2014 Share Posted September 4, 2014 thank you sir very much its works good Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 4, 2014 Share Posted September 4, 2014 thank you sir very muchits works good I am happy to hear that . Enjoy it Quote Link to comment Share on other sites More sharing options...
wrightjd Posted March 15, 2015 Share Posted March 15, 2015 Hi, I know I'm jumping on an old thread but I've looking for help to delete 2 lines in particular from a few hundred drawings. Haven't been able to write/find a lisp code that deletes particular lines from a drawing. The lines are always in the same spot. This was the closest lisp I found that could do it. I was going to use this then use a script to call in all drawings. Only problem is it prompts me to select objects before starting each drawing. Anyway I could tweak the code to not have to select the area/objects? There are only two lines of this length in all drawings. Thanks in advance 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.