Guest balajibth84 Posted October 8, 2010 Share Posted October 8, 2010 If I understand you correctly you would like to simplify the Multiply and Divide lisp so it acts more like the Add and Subtract lisp. Is that right? What is it that you do not like about the Multiply and Divide lisp exactly? I have not tested the lisp routine myself so I do not know what questions it is asking. HAi remark i want the output(Multiply and Divide)just single select....What ever text i am selecting using tracking method immediately that output should execute in our cad command pallate....PLz chk amv attached add and subtraction lisp.......Just i am giving add and i am selecting the Text means its executing the output..Same model i want(Single click)......... Link to comment Share on other sites More sharing options...
ReMark Posted October 8, 2010 Share Posted October 8, 2010 To get a better idea of what you are seeing I will have to try the lisp routine first. Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 8, 2010 Share Posted October 8, 2010 To get a better idea of what you are seeing I will have to try the lisp routine first. Sure Thanks Remark..PLz try....Plz see the this thread 2nd page...There is add and subtract lisp availble....I want same like that..so plz take that for a reference...thanks in advance.......... Link to comment Share on other sites More sharing options...
Cad64 Posted October 8, 2010 Share Posted October 8, 2010 Ok balajibth84, for the third time, please read the CODE POSTING GUIDELINES: http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines. You need to post your code in the correct format. Link to comment Share on other sites More sharing options...
ReMark Posted October 8, 2010 Share Posted October 8, 2010 In my opinion the lisp routine Combinevalues as generously contributed by alanjt is your best solution. It is simple to follow, requires very few clicks to use, and provides immediate results on the command line and allows the user to also place the result within the drawing using the same text style (layer, color, height, and rotation) as that which is selected. The user simply tells AutoCAD what arithmetic function is to be used and then they make but two picks. It could not be an easier. To prove it look at this: Command: av (the command to get things started) Choose function [Add/Divide/Multiply/Subtract] : m (for Multiply) Select text object to Multiply or [Type]: 7.0 * Select text object to Multiply or [Add/Divide/Multiply/Subtract/Type]: 7.0 * 5.0 = 35.0 Select text object to Multiply or [Add/Divide/Multiply/Subtract/Type]: *Cancel* I did not elect to have the output included in the drawing but the option is available. I think we're done now don't you? Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 9, 2010 Share Posted October 9, 2010 (edited) In my opinion the lisp routine Combinevalues as generously contributed by alanjt is your best solution. It is simple to follow, requires very few clicks to use, and provides immediate results on the command line and allows the user to also place the result within the drawing using the same text style (layer, color, height, and rotation) as that which is selected. The user simply tells AutoCAD what arithmetic function is to be used and then they make but two picks. It could not be an easier. To prove it look at this: Command: av (the command to get things started) Choose function [Add/Divide/Multiply/Subtract] : m (for Multiply) Select text object to Multiply or [Type]: 7.0 * Select text object to Multiply or [Add/Divide/Multiply/Subtract/Type]: 7.0 * 5.0 = 35.0 Select text object to Multiply or [Add/Divide/Multiply/Subtract/Type]: *Cancel* I did not elect to have the output included in the drawing but the option is available. I think we're done now don't you? Remark i have tried..But its not working properly....See this is My final reply...Try to understand me....PLz... Just try my Add and Subtraction lisp first(Below mentioned)...Suppose i am adding means Like (Some text is available in Dwg like 123+12+34+45+67="281")...In my below lisp it will generate that output(281) after just selection(Tracking Selection)....So same like i want for multiple and Divide.....here what is the problem???u r understand now??? #(defun C:ADD (/ S1 LG INDEX A B C D) (setq S1 (ssget) LG (sslength S1) INDEX 0 C 0 ) ;_ end of setq (while (/= INDEX LG) (setq A (entget (ssname S1 INDEX)) D (cdr (assoc 0 A)) ) ;_ end of setq (if (= D "TEXT") (progn (setq B (atof (cdr (assoc 1 A))) C (+ C B) ) ;_ end of setq ) ;_ end of progn ) ;_ end of if (setq INDEX (1+ INDEX)) ) ;_ end of while (princ "\nTotal Value: ") (princ C) (princ) ) ;end defun (defun C:SUB (/ MS ML INDEXM CM MA MD MB CM S LG INDEX A B C C1 D ) (prompt "SELECT the MAIN Number(s): ") (setq MS (ssget) ML (sslength MS) INDEXM 0 CM 0 ) ;_ end of setq (while (/= INDEXM ML) (setq MA (entget (ssname MS INDEXM)) MD (cdr (assoc 0 MA)) ) ;_ end of setq (if (= MD "TEXT") (progn (setq MB (atof (cdr (assoc 1 MA))) CM (+ CM MB) ) ;_ end of setq ) ;_ end of progn ) ;_ end of if (setq INDEXM (1+ INDEXM)) ) ;_ end of while (prompt "\nSelect the NUMBERS to be DUDUCTED: ") (setq S (ssget) LG (sslength S) INDEX 0 C 0 ) ;_ end of setq (while (/= INDEX LG) (setq A (entget (ssname S INDEX)) D (cdr (assoc 0 A)) ) ;_ end of setq (if (= D "TEXT") (progn (setq B (atof (cdr (assoc 1 A))) C (+ C B) ) ;_ end of setq ) ;_ end of progn ) ;_ end of if (setq INDEX (1+ INDEX)) ) ;_ end of while (setq C1 (- CM C)) (princ "\nNett value: ") (princ C1) (princ) ; -------------------------------------------------------------------- ) ;---end defun# Edited October 12, 2010 by Tiger added codetags Link to comment Share on other sites More sharing options...
Cad64 Posted October 9, 2010 Share Posted October 9, 2010 balajibth84 please check your Private Messages. I have sent you a PM. Link to comment Share on other sites More sharing options...
ReMark Posted October 9, 2010 Share Posted October 9, 2010 balajibth84: I've done my best. I apologize but I cannot provide an answer to your problem. I hope you are able to come up with a solution that works for you. Regards, ReMark Albert Einstein: Definition of insanity: "Doing the same thing over and over again and expecting different results." Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 19, 2010 Share Posted October 19, 2010 Hai You have Any Lisp For Multiple the Text?Like in Dwg Some Text is Availble. 2 3 4 5 I am Selecting this Text and Give Multiple means its shouldbe execute the Result "120".So can you give any code for this ???? Link to comment Share on other sites More sharing options...
ReMark Posted October 19, 2010 Share Posted October 19, 2010 balajibth84: I think we have provided all the answers we can possibly give you on the subject. No offense but as far as this thread is concerned I really do not want to participate any more. We just keep going around in the same old circle again, and again, and again, and a........ And just one last time. It's multiply the text not multiple. Link to comment Share on other sites More sharing options...
alanjt Posted October 19, 2010 Share Posted October 19, 2010 I still say the linked function I provided is your best option. However, just swap the "+" in the addition function for a "*" and it will multiply. Granted, you cannot do this for divide, since order matters. eg. (/ 3. 5. 6.) -> 0.1 (/ 5. 6. 3.) -> 0.2777777 Link to comment Share on other sites More sharing options...
ReMark Posted October 19, 2010 Share Posted October 19, 2010 You're a real trooper Alan. You get today's Gold star. Link to comment Share on other sites More sharing options...
Cad64 Posted November 2, 2010 Share Posted November 2, 2010 Thread cleaned up and closed. Link to comment Share on other sites More sharing options...
Recommended Posts