<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SUM MTXT in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13662650#M164419</link>
    <description>&lt;P&gt;Just a suggestion use lowercase in posts. Capitals can be known as shouting, used here some times when people get frustrated with a poster not following instructions.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 00:47:01 GMT</pubDate>
    <dc:creator>Sea-Haven</dc:creator>
    <dc:date>2025-06-03T00:47:01Z</dc:date>
    <item>
      <title>SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13660990#M164399</link>
      <description>&lt;P&gt;WHY CAN'T MY LSP FIND THE RESPECTIVE MTEXT, WHICH HAS THE INPUT, A BREAK AND IN THE SEQUENCE THE VALUE. IT CANNOT ORGANIZE THE LIST, ADD THE ITEMS BY THE INPUT AND ADD THE VALUE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun TOTAL (/ ss ent i txt valor texto QA QB QC QD)&lt;BR /&gt;(setq A 0.0 B 0.0 C 0.0 D 0.0 )&lt;BR /&gt;(setq ss (ssget "_X" '((0 . "MTEXT"))))&lt;BR /&gt;(if ss&lt;BR /&gt;(progn&lt;BR /&gt;(setq i 0)&lt;BR /&gt;(while (&amp;lt; i (sslength ss))&lt;BR /&gt;(setq ent (ssname ss i))&lt;BR /&gt;(setq txt (cdr (assoc 1 (entget ent))))&lt;BR /&gt;(if valor&lt;BR /&gt;(cond&lt;BR /&gt;((wcmatch txt "*A*") (setq QA (+ QA valor)))&lt;BR /&gt;((wcmatch txt "*B*") (setq QB (+ QB valor)))&lt;BR /&gt;((wcmatch txt "*C*") (setq QC (+ QC valor)))&lt;BR /&gt;((wcmatch txt "*D*") (setq QD (+ QD valor)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(setq texto&lt;BR /&gt;(strcat&lt;BR /&gt;"\n TOTAL TEXT\n\n"&lt;BR /&gt;"SUM TEXT A → " (rtos QA 2 2) " \n"&lt;BR /&gt;"SUM TEXT B → " (rtos QB 2 2) " \n"&lt;BR /&gt;"SUM TEXT C → " (rtos QC 2 2) " \n"&lt;BR /&gt;"SUM TEXT D → " (rtos QD2 2) " \n"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ texto)&lt;BR /&gt;)&lt;BR /&gt;(princ "\nNo MTEXT found in drawing.")&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 09:27:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13660990#M164399</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-06-02T09:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13661048#M164400</link>
      <description>&lt;P&gt;There were too many issues with the code... You can compare the codes, see, and ask if you really want to know why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;
(defun TOTAL (/ LM:str-&amp;gt;lst ss ent i txt lst valor texto QA QB QC QD)
  
  ;; String to List  -  Lee Mac
  ;; Separates a string using a given delimiter
  ;; str - [str] String to process
  ;; del - [str] Delimiter by which to separate the string
  ;; Returns: [lst] List of strings
  
  (defun LM:str-&amp;gt;lst ( str del / pos )
    (if (setq pos (vl-string-search del str))
      (cons (substr str 1 pos) (LM:str-&amp;gt;lst (substr str (+ pos 1 (strlen del))) del))
      (list str)
      )
    )
  
  (setq QA 0.0 QB 0.0 QC 0.0 QD 0.0 )
  (setq ss (ssget "_X" '((0 . "MTEXT"))))
  (if ss
    (progn
      
      (repeat (setq i (sslength ss))
	(setq ent (ssname ss (setq i (1- i))))
	(setq txt (getpropertyvalue ent "Text"))
	(setq lst (LM:str-&amp;gt;lst txt "\r\n"))
	(setq txt (car lst))
	(setq valor (atof (last lst)))
	(if (and txt valor)
	  (progn
	    (cond
	      ((wcmatch txt "*A*") (setq QA (+ QA valor)))
	      ((wcmatch txt "*B*") (setq QB (+ QB valor)))
	      ((wcmatch txt "*C*") (setq QC (+ QC valor)))
	      ((wcmatch txt "*D*") (setq QD (+ QD valor)))
	      
	      )
	    
	    (setq texto
		   (strcat
		     "\n TOTAL TEXT\n\n"
		     "SUM TEXT A › " (rtos QA 2 2) " \n"
		     "SUM TEXT B › " (rtos QB 2 2) " \n"
		     "SUM TEXT C › " (rtos QC 2 2) " \n"
		     "SUM TEXT D › " (rtos QD 2 2) " \n"
		     )
		  )
	    (princ texto)
	    ))))
    (princ "\nNo MTEXT found in drawing.")
    )
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 09:56:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13661048#M164400</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-06-02T09:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13662217#M164411</link>
      <description>&lt;P&gt;CONGRATULATIONS, CHECKMATE!!!&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;BR /&gt;I AM NOT A PROGRAMMER, BUT I BELIEVE THAT THE ADD FRAGMENT SEARCHES FOR THE NUMBER THAT IS FOUND AFTER \\P BECAUSE WHAT IS BEFORE IT IS TEXT, AND THEREFORE, FOR THE ADDING PROCESS ALL TEXT IS DISCARDED.&lt;BR /&gt;I GOT CLOSER!!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 18:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13662217#M164411</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-06-02T18:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13662650#M164419</link>
      <description>&lt;P&gt;Just a suggestion use lowercase in posts. Capitals can be known as shouting, used here some times when people get frustrated with a poster not following instructions.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 00:47:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13662650#M164419</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-06-03T00:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13664218#M164444</link>
      <description>&lt;P&gt;Hello, I didn't know there was an etiquette rule, the capital letters were to separate programming and conversation... but, noted!&lt;/P&gt;&lt;P&gt;The next, i will follow this rule. Sorry if I was rude at any time.&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Gratefulness!!!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 19:26:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13664218#M164444</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-06-03T19:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: SUM MTXT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13664502#M164450</link>
      <description>&lt;P&gt;Not a problem at all. Use the &amp;lt;/&amp;gt; for your code up at the top, it will separate it.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 00:26:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-mtxt/m-p/13664502#M164450</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-06-04T00:26:47Z</dc:date>
    </item>
  </channel>
</rss>

