<?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: Updating parameter value in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265582#M36416</link>
    <description>&lt;P&gt;Please find attached the AutoCAD VB .NET Program, sample AutoCAD 2012 drawing and the PPT containing the error message.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 12:10:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-12T12:10:38Z</dc:date>
    <item>
      <title>Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265311#M36414</link>
      <description>&lt;P&gt;I am newbie for AutoCAD VB .NET programming.&lt;/P&gt;&lt;P&gt;I have a requirement to get a parameter value thro' VB .NET GUI and based on the value update a parameter in AutoCAD 2012 drawing (since my client is using AutoCAD 2012).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the post&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/net/update-a-parametric-dimension-value-using-net-c-or-vb/m-p/4969130#M40235" target="_blank"&gt;&lt;SPAN&gt;Update&lt;/SPAN&gt; a parametric dimension &lt;SPAN&gt;value&lt;/SPAN&gt; using .NET (C# or VB)&lt;/A&gt;&amp;nbsp;and tried the code provided in&lt;/P&gt;&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2012/03/working-with-associative-parameters-from-api.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/03/working-with-associative-parameters-from-api.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I converted the C# code provided in the above link to VB .NET and it works. But I am unable to enter a numeric value in the code.&lt;/P&gt;&lt;P&gt;I have attached my code and AutoCAD 2012 drawing file I am using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code seems to fail at&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim var As AssocVariable = TryCast(Tx.GetObject(variableId, OpenMode.ForWrite), AssocVariable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 08:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265311#M36414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T08:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265489#M36415</link>
      <description>&lt;P&gt;There is some issue with uploading attachments. I will upload after sometime.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 11:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265489#M36415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T11:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265582#M36416</link>
      <description>&lt;P&gt;Please find attached the AutoCAD VB .NET Program, sample AutoCAD 2012 drawing and the PPT containing the error message.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 12:10:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6265582#M36416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T12:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6266247#M36417</link>
      <description>&lt;P&gt;Please find attached the AutoCAD 2012 drawing and the PPT containing the error message&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6266247#M36417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T16:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6266359#M36418</link>
      <description>&lt;P&gt;Please find attached the PPT with error message&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:57:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6266359#M36418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T16:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6275824#M36419</link>
      <description>&lt;P&gt;I made some progress especially during this weekend after spending long hours&lt;/P&gt;&lt;P&gt;The issue seems to be related to VB .NET GUI and VB .NET program opeining the AutoCAD drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program fails in the following statement (Tx.GetObject method fails when we try with ForWrite Open mode)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp; Using&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; Tx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Transaction&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = variableId.Database.TransactionManager.StartTransaction()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; dbo &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;DBObject&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; = Tx.GetObject(variableId, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;OpenMode&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.ForWrite)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following are my observations after several experimentation&lt;/P&gt;&lt;P&gt;1) The parameters get updated and progrm works successfully - if there is no VB .NET GUI and the AutoCAD drawing is active &amp;amp; open&lt;/P&gt;&lt;P&gt;2) The parameters get updated and progrm works successfully - if there is modal VB .NET GUI (form.ShowDialog()) and the AutoCAD drawing is active &amp;amp; open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) The parameters do not get updated and progrm fails&amp;nbsp;- if there is&amp;nbsp;modaless VB .NET GUI (form.Show())&amp;nbsp;and the AutoCAD drawing is active &amp;amp; open&lt;/P&gt;&lt;P&gt;4)&amp;nbsp;The parameters do not get updated and progrm fails - if there is modal VB .NET GUI (form.ShowDialog()) and VB .NET opens the AutoCAD drawing&lt;/P&gt;&lt;P&gt;5)&amp;nbsp;The parameters do not get updated and progrm fails - if there is modaless VB .NET GUI (form.Show()) and VB .NET opens the AutoCAD drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the program and the drawing. Appreciate any help&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 06:40:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6275824#M36419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-18T06:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6276221#M36420</link>
      <description>&lt;H3 class="entry-header font-entryheader"&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2012/05/adding-or-modifying-the-database-from-modeless-dialog-box.html" target="_blank"&gt;Adding or modifying the database from modeless dialog box.&lt;/A&gt;&lt;/H3&gt;</description>
      <pubDate>Mon, 18 Apr 2016 11:25:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6276221#M36420</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2016-04-18T11:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6279471#M36421</link>
      <description>You do not use Form.Show/ShowDialog(). Instead, use Autodrsk.AutoCad.ApplicationServices.Application.ShowModelessDialog/ShowModalDialog().&lt;BR /&gt;&lt;BR /&gt;When using modelss dialog, it is very likely you command is in session context (I.e. CommandFlsgs.Session is set). In this case, you need lock the document before modifying drawing database.&lt;BR /&gt;&lt;BR /&gt;Also, it is by design that you cannot open a drawing document when a modal dialog box displays. This is different behaviour from Acad VBA.&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Apr 2016 15:15:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6279471#M36421</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2016-04-19T15:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6284873#M36422</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Alexander.Rivilis, Norman Yuan,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;All I had to do was to lock the drawing document before start of transaction. The code I added for lock is&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using lock As Autodesk.AutoCAD.ApplicationServices.DocumentLock = doc.LockDocument()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have attached the updated code along with the sample drawing.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PV Subramanian&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 16:28:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6284873#M36422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-21T16:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Updating parameter value</title>
      <link>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6284878#M36423</link>
      <description>&lt;P&gt;Please find the attachments&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 16:29:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updating-parameter-value/m-p/6284878#M36423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-21T16:29:51Z</dc:date>
    </item>
  </channel>
</rss>

