anaskattayil Posted July 27, 2014 Share Posted July 27, 2014 I have one drawing with above 1000 ground level. I need to add a common value with that levels . any lisp for that calculation. Please help me. I attached that sample drawing. Please help me. Eg. 269.222+0.253 269.235 + 0.253 279.325+0.253 Etc......... I got one lisp for that but one problem, if iam using that lisp, i need to select all numbers one by one. so pls help for me adding that value at one time............. new block.dwg Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2014 Share Posted July 27, 2014 Try this program. Quote Link to comment Share on other sites More sharing options...
anaskattayil Posted July 30, 2014 Share Posted July 30, 2014 Thanks Mr. Lee. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 31, 2014 Share Posted July 31, 2014 You're welcome Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted August 6, 2014 Share Posted August 6, 2014 Hi my friends! I'd like to sum numbers with comma. e.g 320,10+320,11=640,21 Thank in advance Quote Link to comment Share on other sites More sharing options...
wj chen Posted June 9, 2015 Share Posted June 9, 2015 the code is just great, Thanks a lot. WJ chen from Muscat, Oman Quote Link to comment Share on other sites More sharing options...
wj chen Posted June 9, 2015 Share Posted June 9, 2015 Thanks Fixo. Great Code. WJ Chen Muscat Oman:shock: Quote Link to comment Share on other sites More sharing options...
folderdash Posted August 6, 2018 Share Posted August 6, 2018 http://www.cadtutor.net/forum/showthread.php?46688-Combinevalues.LSP-Add-Divide-Multiply-Subtract-object-values Is multiple object selection (window selection or objects in a closed polyline) possible? Thanks Quote Link to comment Share on other sites More sharing options...
shadi Posted August 15, 2020 Share Posted August 15, 2020 On 8/12/2008 at 10:53 PM, fixo said: Do not agreed with you The Earth is so small, take a look on map - just 5-6 thousand of miles or so Here is edited version This will create the new text entity with the same properties as the first selected text has (defun C:STX (/ cpent elist en ip newtxt pt ss sum sumtxt txt) (princ "\n\t\t>>> Select text to get summ >>>") (if ;;select texts/mtexts on screen : (setq ss (ssget '((0 . "*TEXT")))) ;; if selected then : (progn ;; store the first text entity for using 'em further : (setq cpent (ssname ss 0)) ;; set initial sum to zero : (setq sum 0.) ;; loop trough selected texts/mtexts : (while ;; get the first text in selection : (setq en (ssname ss 0)) ;; get entity list of them : (setq elist (entget en)) ;; get the textstring by key 1 from entity list : (setq txt (cdr (assoc 1 elist))) ;; create output string : (setq sumtxt ;; concatenate strings : (strcat ;; convert digits to string : (rtos ;; add to summ the digital value of text : (setq sum (+ (atof txt) sum)) ;; 2 is for metric units (3 for engineering) : 2 ;; set precision by current : (getvar "dimdec"))) ) ;; delete entity from selection set : (ssdel en ss) ) ;; display message in the command line: (princ (strcat "\nSumm=" sumtxt)) (setq pt (getpoint "\nSpecify the new text location: ")) ;; get the insertion point of stored entity : (setq ip (cdr (assoc 10 (entget cpent)))) ;; copy text entity to the new destination point : (command "_copy" cpent "" ip pt) ;; get the last created entity : (setq newtxt (entlast)) ;; get entity list of them : (setq elist (entget newtxt)) ;; modify entity list with new text string : (entmod (subst (cons 1 sumtxt)(assoc 1 elist) elist)) ;; update changes : (entupd newtxt) ) ) (princ) ) (princ "\nStart command with STX...") (princ) hi , good evening or night there , i tried this lisp and it is pretty good , just please if u could help me , that would be so kind from u ,.... i wanna delete the selected texts after being added thanks in advance best regards ~'J'~ 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.