<?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: Changing system variables in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3111250#M59884</link>
    <description>&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;Is there a similar way to change the document variable settings?&lt;/P&gt;&lt;P&gt;I also want to change things like the drawing annotation scale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2011 08:16:44 GMT</pubDate>
    <dc:creator>SRSDS</dc:creator>
    <dc:date>2011-08-02T08:16:44Z</dc:date>
    <item>
      <title>Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110822#M59881</link>
      <description>&lt;P&gt;I want a few sendcommands executed when AutoCAD starts up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim doc As Document = Application.DocumentManager.MdiActiveDocument &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;doc.SendStringToExecute("ANNOAUTOSCALE 4" &amp;amp; vbCr, False, False, True) &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DocumentCreated or DocumentActivated events doen't seem to trigger on start up so i've added them to the initialize sub.&amp;nbsp;(Maybe the dll isn't loaded at this point)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the initialize sub then they are ignored.Commandline looks like this:&lt;/P&gt;&lt;P&gt;Command:&lt;/P&gt;&lt;P&gt;AutoCAD menu utilities loaded.ANNOAUTOSCALE 4&lt;/P&gt;&lt;P&gt;CANNOSCALE 1:100&lt;/P&gt;&lt;P&gt;Command: _RIBBON﻿﻿﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If I put them in a routine they are slow and get minced in with other commands.﻿ Can anyone suggest a good place. Ir is SendStringToExecute not the right method?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 18:49:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110822#M59881</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2011-08-01T18:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110876#M59882</link>
      <description>&lt;P&gt;You could try to set the variable programmitically instead of sending commands using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable﻿(variable, value)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 19:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110876#M59882</guid>
      <dc:creator>michael_robertson</dc:creator>
      <dc:date>2011-08-01T19:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110904#M59883</link>
      <description>&lt;DIV&gt;&lt;P&gt;Exactly what I'm after.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got an error saying SetSystemVariable﻿﻿ is not a member of&amp;nbsp;Autodesk.AutoCAD.ApplicationServices.Application.&lt;/P&gt;&lt;P&gt;But google it and found &amp;nbsp;Application.SetSystemVariable("MAXSORT", 100)﻿&lt;/P&gt;&lt;P&gt;Thankyou!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Aug 2011 20:11:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3110904#M59883</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2011-08-01T20:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3111250#M59884</link>
      <description>&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;Is there a similar way to change the document variable settings?&lt;/P&gt;&lt;P&gt;I also want to change things like the drawing annotation scale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2011 08:16:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3111250#M59884</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2011-08-02T08:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273539#M59885</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/786488"&gt;@SRSDS&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;Is there a similar way to change the &lt;FONT size="4"&gt;&lt;STRONG&gt;document variable&lt;/STRONG&gt;&lt;/FONT&gt; settings?&lt;/P&gt;&lt;P&gt;I also want to change things like the drawing annotation scale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Excellent Question!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody?&amp;nbsp; Does the document have to be opened and active?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:30:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273539#M59885</guid>
      <dc:creator>pjfontes</dc:creator>
      <dc:date>2011-12-23T16:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273547#M59886</link>
      <description>&lt;P&gt;Some you can set through the Database object like Database.Cannoscale if that is what you are talkink about&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:40:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273547#M59886</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2011-12-23T16:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273559#M59887</link>
      <description>&lt;P&gt;Great!&amp;nbsp; I knew I was over-thinking it..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; acDoc &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;As &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT size="2"&gt;Document = Application.DocumentManager.MdiActiveDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; acCurDb &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;As &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT size="2"&gt;Database = acDoc.Database&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;acCurDb.Attmode = MyValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:58:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3273559#M59887</guid>
      <dc:creator>pjfontes</dc:creator>
      <dc:date>2011-12-23T16:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3275419#M59888</link>
      <description>&lt;P&gt;You can use the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.ApplicationServices
Try
    Dim lms As Object = Application.GetSystemVariable("CANNOSCALE")
    Application.SetSystemVariable("CANNOSCALE", lms)
Catch ex As Autodesk.AutoCAD.Runtime.Exception
End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If a drawing is not open for a drawing based variable you will get an eInvalidInput exception. So you can mask that with the error trapping plus the error trapping helps if the version of AutoCAD does not support the variable you are using.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 00:04:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3275419#M59888</guid>
      <dc:creator>GTVic</dc:creator>
      <dc:date>2011-12-28T00:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3276015#M59889</link>
      <description>&lt;P&gt;Why not use Database.Cannoscale?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 17:46:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3276015#M59889</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2011-12-28T17:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing system variables</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3276227#M59890</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Why not use Database.Cannoscale?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I understood that CANNOSCALE was just an example of the type of variable he would like to set so&amp;nbsp;my suggestion&amp;nbsp;is&amp;nbsp;a generic solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a side topic, I noticed that other 3rd party apps can have the problem&amp;nbsp;of interrupting the startup sequence when using SendStringToExecute. When I had AutoCAD 2009 infected with the Adobe plug-in I would get an Adobe initialization&amp;nbsp;message on the commandline followed by "Unknown command: OMMANDLINE" (missing the 'C') because AutoCAD was probably&amp;nbsp;doing it's own SendStringToExecute of "COMMANDLINE" that was being interrupted by the Adobe plug-in. IMO, Autodesk shouldn't be programming its products this way but if you have to use SendStringToExecute I think there is a function you can call to make sure other commands are not being executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DocumentManager.MdiActiveDocument.Editor.Document.CommandInProgress&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or perhaps a document lock would work but I wonder if that could crash another plug-in that was trying to initialize. Assuming the other plug-in was not written properly.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 21:44:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-system-variables/m-p/3276227#M59890</guid>
      <dc:creator>GTVic</dc:creator>
      <dc:date>2011-12-28T21:44:57Z</dc:date>
    </item>
  </channel>
</rss>

