<?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: DXF code usage in python in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10842584#M50851</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-8426BA72-1852-40BC-84D4-F63F49A0DE74" target="_blank" rel="noopener"&gt;SetXrecordData&lt;/A&gt; method needs two arrays as arguments (data_type and data_value).&lt;/P&gt;
&lt;P&gt;The 102 code group is only used for curly braces ("{" and "}") for grouping data.&lt;/P&gt;
&lt;P&gt;You should try something like this (not tested, I do not use Python for AutoCAD customization)&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;data_type = [1]
data_value = ["Hello"]
p_xrecord.SetXRecordData(data_type, data_value)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Dec 2021 17:48:25 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2021-12-25T17:48:25Z</dc:date>
    <item>
      <title>DXF code usage in python</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10842373#M50850</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on the pyautocad module to automate autocad tasks using python as a substitute to LISP/VBA. But while using commands which need the dxf group codes I am facing problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;A href="https://help.autodesk.com/view/ACD/2017/ESP/?guid=GUID-EF0393EC-8446-4989-8C72-F3AE49D81176" target="_blank"&gt;https://help.autodesk.com/view/ACD/2017/ESP/?guid=GUID-EF0393EC-8446-4989-8C72-F3AE49D81176&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As given in the link above, we have to use DXF codes as XDataType. But when I try using the same with python, It's not working. The code is given below:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; pyautocad &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; Autocad, APoint, aDouble&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;acad = Autocad(&lt;/SPAN&gt;&lt;SPAN&gt;create_if_not_exists&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;#Create Object&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p = acad.model.AddPoint(APoint(&lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Add dictionary to an object&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p_dict = p.GetExtensionDictionary()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Check if the dictionary has been assigned to the object&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(p.HasExtensionDictionary)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Add X Record in the dictionary&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p_xrecord = p_dict.AddXRecord(&lt;/SPAN&gt;&lt;SPAN&gt;"Object1"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(p_xrecord) &lt;/SPAN&gt;&lt;SPAN&gt;#XRecord&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Add Data into XRecord&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(p_xrecord.Name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p_xrecord.SetXRecordData(&lt;/SPAN&gt;&lt;SPAN&gt;102&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Hello"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;I would like to know the possible solutions to this.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 13:18:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10842373#M50850</guid>
      <dc:creator>tanmayms3009</dc:creator>
      <dc:date>2021-12-25T13:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: DXF code usage in python</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10842584#M50851</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-8426BA72-1852-40BC-84D4-F63F49A0DE74" target="_blank" rel="noopener"&gt;SetXrecordData&lt;/A&gt; method needs two arrays as arguments (data_type and data_value).&lt;/P&gt;
&lt;P&gt;The 102 code group is only used for curly braces ("{" and "}") for grouping data.&lt;/P&gt;
&lt;P&gt;You should try something like this (not tested, I do not use Python for AutoCAD customization)&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;data_type = [1]
data_value = ["Hello"]
p_xrecord.SetXRecordData(data_type, data_value)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 17:48:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10842584#M50851</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2021-12-25T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: DXF code usage in python</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843016#M50852</link>
      <description>&lt;P&gt;Thanks a lot for your response&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried passing arrays as input to that command previously, but it did not work.&lt;/P&gt;&lt;P&gt;Even the VBA/LISP documentation on the official AutoCAD page shows that we need to pass arrays. But it isn't working with python. I hope there is some way to perform this task.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 04:58:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843016#M50852</guid>
      <dc:creator>tanmayms3009</dc:creator>
      <dc:date>2021-12-26T04:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: DXF code usage in python</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843037#M50853</link>
      <description>&lt;P&gt;&lt;A href="https://forum.dynamobim.com/t/civil-3d-toolkit-feedback-thread/43570/362" target="_blank"&gt;https://forum.dynamobim.com/t/civil-3d-toolkit-feedback-thread/43570/362&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 993px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1005075i769900EE6A3C6644/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 05:58:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843037#M50853</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-27T05:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: DXF code usage in python</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843523#M50854</link>
      <description>&lt;P&gt;Thanks a lot for the reply&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6591997"&gt;@hosneyalaa&lt;/a&gt;&amp;nbsp;. I'll try using dynamo too.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 16:26:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dxf-code-usage-in-python/m-p/10843523#M50854</guid>
      <dc:creator>tanmayms3009</dc:creator>
      <dc:date>2021-12-26T16:26:22Z</dc:date>
    </item>
  </channel>
</rss>

