<?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: Change item in Field Expression in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568919#M56696</link>
    <description>&lt;P&gt;Here's a simple demo&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(Defun c:demo ( / lw p1 p2 _LWArea LW_ID mt )
(if
  (and
	(setq LW  (ssget "_+.:S:E:L" '((0 . "LWPOLYLINE")(8 . "##,###"))))
	(setq p1 (getpoint "\nPick target point"))
	(setq p2 (getpoint p1 "\nText Location"))
	)
    (progn
      (setq LW_ID (itoa (vla-get-ObjectID (setq ev (vlax-ename-&amp;gt;vla-object (ssname LW 0))))))
      
      (setq _LWArea     
                    (strcat
                        "%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId " LW_ID
                        "&amp;gt;%).Area&amp;gt;%")
                   )
	(setq str
		      (strcat "%&amp;lt;\\AcExpr "
			      "(("
			      _LWArea ")*"
			      (vla-get-layer ev) 
			      ") \\f \"%lu2%pr2\"&amp;gt;%"
		      )
	       )
        (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))
      	(setq mt (entmakex (list (cons 0 "MTEXT")         
                  (cons 100 "AcDbEntity")
                  (cons 100 "AcDbMText")
                  (cons 10 p2)
                  (cons 1 "X")))
	    )
        (vla-put-textstring (vlax-ename-&amp;gt;vla-object mt) str)
		  )
      )
(princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 09:54:43 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2021-08-24T09:54:43Z</dc:date>
    <item>
      <title>Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10564308#M56687</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;How can we update a formula field with the help of Lisp after copying it?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 10:02:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10564308#M56687</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-22T10:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10565443#M56688</link>
      <description>&lt;P&gt;Not sure about your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A field in this example is using an object ID so each one is different hence using a Area.lsp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want say sq Metres not mm then again its in the field formula adjust in code.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 02:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10565443#M56688</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-08-23T02:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10565640#M56689</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;In the first field, the formula is used as follows:&lt;/P&gt;&lt;P&gt;(Area of polygon 1 * Layer 1 text content)&lt;/P&gt;&lt;P&gt;I want to copy the initial field for the next polygon after selecting new polygon updated copied field:&lt;/P&gt;&lt;P&gt;(Area of polygon 2 * Layer 2 text content)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible by Lisp?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 05:51:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10565640#M56689</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-23T05:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10567204#M56690</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/520578"&gt;@neam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;..I want to copy the initial field for the next polygon after selecting new polygon updated copied field:&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;In the sample drawing you posted, Both Field1 and Field2 shows the value of the LWPOLYLINE area multiplied by the layer name, but has nothing to do with each other. So i dont get the question.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Somehow the way you explain it is similar to how the the Jeremy Bearimy Timeline works. and yes it broke me too. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 18:29:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10567204#M56690</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-23T18:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568457#M56691</link>
      <description>&lt;P&gt;I edited field 2 manually.&lt;/P&gt;&lt;P&gt;Please, if possible, this edit should be done by Lisp program:&lt;/P&gt;&lt;P&gt;1- select field 2.&lt;/P&gt;&lt;P&gt;2- select new polygon.&lt;/P&gt;&lt;P&gt;3- update items in field 2 (area and layer name).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 06:27:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568457#M56691</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-24T06:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568541#M56692</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/520578"&gt;@neam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I edited field 2 manually.&lt;/P&gt;
&lt;P&gt;Please, if possible, this edit should be done by Lisp program:&lt;/P&gt;
&lt;P&gt;1- select field 2.&lt;/P&gt;
&lt;P&gt;2- select new polygon.&lt;/P&gt;
&lt;P&gt;3- update items in field 2 (area and layer name).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I'm not sure if what you shown on the drawing is what the final product would be&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Do you really want a line and an MTEXT that's pointing to the polyline?&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Does that mean copy the Mtext, create a line&amp;nbsp; and update MTEXT string value?.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Are you planning to replace the label "5-4-3" with attributed blocks and will that be where the filed values would go that is connected to a datalink table?&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 06:54:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568541#M56692</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-24T06:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568637#M56693</link>
      <description>&lt;P&gt;omg&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Do you really want a line and an MTEXT that's pointing to the polyline?&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;answer: NO&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Does that mean copy the Mtext, create a line&amp;nbsp; and update MTEXT string value?.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;answer: NO&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Are you planning to replace the label "5-4-3" with attributed blocks and will that be where the filed values would go that is connected to a datalink table?&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;answer: NO&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I create one field for one polygon.&lt;/P&gt;&lt;P&gt;copy this field to others polygons.&lt;/P&gt;&lt;P&gt;Updated copied fields by click on polygon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 07:47:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568637#M56693</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-24T07:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568684#M56694</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/520578"&gt;@neam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;omg&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Does that mean &lt;STRONG&gt;copy the Mtext&lt;/STRONG&gt;, create a line&amp;nbsp; and update MTEXT string value?.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;answer: &lt;STRONG&gt;NO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I create one field for one polygon.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;copy&lt;/STRONG&gt; this field to others polygons.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt; copied fields by click on polygon.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;The answer is &lt;STRONG&gt;YES&lt;/STRONG&gt; to that question, other wise there would be nothing to update. The reason i'm asking this is to know if the program also needs to include the creation of the LINES/MTEXT as the user pick a polygon.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:17:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568684#M56694</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-24T08:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568711#M56695</link>
      <description>&lt;P&gt;Thank you for understanding what I mean by my poor English.&lt;/P&gt;&lt;P&gt;In response to the second part of your post, we must say that it will be great.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:19:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568711#M56695</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-24T08:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568919#M56696</link>
      <description>&lt;P&gt;Here's a simple demo&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(Defun c:demo ( / lw p1 p2 _LWArea LW_ID mt )
(if
  (and
	(setq LW  (ssget "_+.:S:E:L" '((0 . "LWPOLYLINE")(8 . "##,###"))))
	(setq p1 (getpoint "\nPick target point"))
	(setq p2 (getpoint p1 "\nText Location"))
	)
    (progn
      (setq LW_ID (itoa (vla-get-ObjectID (setq ev (vlax-ename-&amp;gt;vla-object (ssname LW 0))))))
      
      (setq _LWArea     
                    (strcat
                        "%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId " LW_ID
                        "&amp;gt;%).Area&amp;gt;%")
                   )
	(setq str
		      (strcat "%&amp;lt;\\AcExpr "
			      "(("
			      _LWArea ")*"
			      (vla-get-layer ev) 
			      ") \\f \"%lu2%pr2\"&amp;gt;%"
		      )
	       )
        (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))
      	(setq mt (entmakex (list (cons 0 "MTEXT")         
                  (cons 100 "AcDbEntity")
                  (cons 100 "AcDbMText")
                  (cons 10 p2)
                  (cons 1 "X")))
	    )
        (vla-put-textstring (vlax-ename-&amp;gt;vla-object mt) str)
		  )
      )
(princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 09:54:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568919#M56696</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-24T09:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568970#M56697</link>
      <description>&lt;P&gt;thank you very much&lt;/P&gt;&lt;P&gt;That's absolutely right&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 10:17:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10568970#M56697</guid>
      <dc:creator>neam</dc:creator>
      <dc:date>2021-08-24T10:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change item in Field Expression</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10569003#M56698</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/520578"&gt;@neam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;thank you very much&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Good for you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/520578"&gt;@neam&lt;/a&gt;, glad i could help&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 10:37:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-item-in-field-expression/m-p/10569003#M56698</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-24T10:37:16Z</dc:date>
    </item>
  </channel>
</rss>

