dpaulku Posted July 15, 2010 Author Share Posted July 15, 2010 Works fine for me - what error do you get? Well here's what I've done with all this code here: Cut and paste into wordpad save as text file w/.lsp extension Say yes to loosing all the formating (that's just for show anyway right?) Load into acad and process the command characters. For the last one, I see "(defun c:2dp ( / ss ) " as the command info so I just type "2dp". I get "Unknown command 2DP" back. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 15, 2010 Share Posted July 15, 2010 Here's a better way to load it: Open your drawing, type VLIDE at the command line, go to File > New File, Paste the code. Click the load button, then type the command at the command line. Else, I think Notepad is better to copy it to. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 15, 2010 Share Posted July 15, 2010 My bubble? Yeah, your response seemed a bit downhearted is all - so I hope I didn't step on your toes by diving in with new code. Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 15, 2010 Share Posted July 15, 2010 Yeah, your response seemed a bit downhearted is all - so I hope I didn't step on your toes by diving in with new code. Oh, not at all. That's why I ended that post with a smile. I had other pressing matters and you seemed eager to step in. It's not like we're getting paid for this stuff. LoL, why'd you quote 'burst' and 'bubble'? Quote Link to comment Share on other sites More sharing options...
dpaulku Posted July 15, 2010 Author Share Posted July 15, 2010 I'm poised for a long weekend now that my mess is cleaned up. Thanks for all the help, I'll try to address my loading/saving issue next week. Cheers! Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 15, 2010 Share Posted July 15, 2010 I'm poised for a long weekend now that my mess is cleaned up. Thanks for all the help, I'll try to address my loading/saving issue next week. Cheers! Always happy to save others time and money. We make that our new CADTutor slogan. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 15, 2010 Share Posted July 15, 2010 Oh, not at all. That's why I ended that post with a smile. I had other pressing matters and you seemed eager to step in. It's not like we're getting paid for this stuff. Ok, no worries LoL, why'd you quote 'burst' and 'bubble'? Got that from you lol Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 15, 2010 Share Posted July 15, 2010 Ok, no worries None at all. Got that from you lol LoL, that's because the OP's routine was called BubbleBurst. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 15, 2010 Share Posted July 15, 2010 (defun c:R2D2 (/ ss) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) ((lambda (i / e l) (while (setq e (ssname ss (setq i (1+ i)))) (setq l (entget e)) (entmod (subst (cons 1 (rtos (atof (cdr (assoc 1 l))) (getvar 'lunits) 2)) (assoc 1 l) l)) ) ) -1 ) ) (princ) ) OK. Nice one.. And if I asked you to change this Lisp to another one things like mine that you commented in that forum, would you help with it ?????? I would like to know. The always honest Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 15, 2010 Share Posted July 15, 2010 OK. Nice one..And if I asked you to change this Lisp to another one things like mine that you commented in that forum, would you help with it ?????? I would like to know. The always honest Tharwat Replace the lambda expression with (setq i -1) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 15, 2010 Share Posted July 15, 2010 the following cod goes with no action' (defun c:test (/ ss i e l) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) [color="Red"](setq i -1)[/color] (while (setq e (ssname ss (setq i (1+ i)))) (setq l (entget e)) (entmod (subst (cons 1 (rtos (atof (cdr (assoc 1 l))) (getvar 'lunits) 2)) (assoc 1 l) l)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 15, 2010 Share Posted July 15, 2010 the following cod goes with no action' (defun c:test (/ ss i e l) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) [color=Red](setq i -1)[/color] (while (setq e (ssname ss (setq i (1+ i)))) (setq l (entget e)) (entmod (subst (cons 1 (rtos (atof (cdr (assoc 1 l))) (getvar 'lunits) 2)) (assoc 1 l) l)) ) ) (princ) ) That's because you put it as part of the IF statement. Why are you trying to change what I posted? Don't fix what isn't broken. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2010 Share Posted July 16, 2010 Why are you trying to change what I posted? I am not changing any of yours and nor anyone ... I am here to get learned and help any if I could. and not to get complete codes or being lost by other's codes ideas... :wink: I changed codes' variables that I posted earlier to meet your style, that's all. And if you have noticed mine in the other forum you will find out that clearly, of course if you want to. it is genuine , (defun c:2r (/ sel objs ents all) (setq sel (ssget "_:L" '((0 . "TEXT")))) (setq objs -1) (while (setq ents (ssname sel (setq objs (1+ objs)))) (setq all (entget ents)) (entmod (subst (cons 1 (rtos (atof (cdr (assoc 1 all)))2 2)) (assoc 1 all) all)) ) (princ) ) No giving up. Tharwat Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 16, 2010 Share Posted July 16, 2010 IF will only take one statement as the 'then' expression and one statement as the 'else' expression. Hence if you want to evaluate more than one expression on these conditions - they must be wrapped, perhaps using 'progn', so that they may be passed to the IF function as one expression. Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 16, 2010 Share Posted July 16, 2010 No giving up. Tharwat I give up. Why are you trying to rewrite a code that already works? We've all provided code that works and you are just trying to write it differently. If you don't understand what we did or a procedure we used, just asked us about it, instead of haphazardly trying to modify it to look more like something you would do. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2010 Share Posted July 16, 2010 I give up. Why are you trying to rewrite a code that already works? We've all provided code that works and you are just trying to write it differently. If you don't understand what we did or a procedure we used, just asked us about it, instead of haphazardly trying to modify it to look more like something you would do. First of all, I am sorry for being direct to points, but this is my conduct. - I do not rewrite things that already made by anyone.Although in public. - I have informed you before that this is not your post or idea, nor nothing related. - If I or anyone else asked for any small help, you would give not more than a hint untill anyone write something any codes against it, so you will show the abilities. As you can see in all my posts, I don't ask for programs, I am still learning and getting information. Sincerly Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 16, 2010 Share Posted July 16, 2010 You miss my point. There are several versions of exactly what you are trying to achieve. Why not try and understand how the existing ones work? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2010 Share Posted July 16, 2010 You miss my point. There are several versions of exactly what you are trying to achieve. Why not try and understand how the existing ones work? If I am not trying to understand codes in general, I won't be here. and if you go back somewhere you will find out that my words were correct and stright to the point. I have asked you directly for a modification but you ignored that. Thank you Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 16, 2010 Share Posted July 16, 2010 Ugh. Set your i variable before you select you text. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2010 Share Posted July 16, 2010 Ugh. Set your i variable before you select you text. I have no i variable in my codes , haven't you noticed that, so what should I do with it (the i) variable ... ??????? (defun c:2r (/ sel objs ents all) (setq sel (ssget "_:L" '((0 . "TEXT")))) (setq objs -1) (while (setq ents (ssname sel (setq objs (1+ objs)))) (setq all (entget ents)) (entmod (subst (cons 1 (rtos (atof (cdr (assoc 1 all)))2 2)) (assoc 1 all) all)) ) (princ) ) Is it OK. Tharwat 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.