<?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: sendcommand in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9198004#M5019</link>
    <description>&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;i will learn then about command macros.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2019 08:29:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-12T08:29:26Z</dc:date>
    <item>
      <title>sendcommand</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9195997#M5017</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;am new at using vba to automate autocad drawings at my job.(topography)&lt;/P&gt;&lt;P&gt;my question here is about the rules of writing sendcommands, i have seen some examples of them but still cant see the logic behind the syntax.&lt;/P&gt;&lt;P&gt;example: &lt;SPAN class="fontstyle0"&gt;.ThisDrawing.SendCommand "._-layer _m " &amp;amp; "TBlk" &amp;amp; vbCr &amp;amp; "_c 8 " &amp;amp; "TBlk" &amp;amp; vbCr &amp;amp; vbCr&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if someone can help me cover and understand the commands syntax at vba i will be gratefull.( vbCR, "_", "._" ...)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 13:57:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9195997#M5017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-11T13:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: sendcommand</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9196443#M5018</link>
      <description>&lt;P&gt;vbCr is the visual basic carriage return. It is equivalent to {Enter} key. It goes back to the old typewriter days. On a typewriter, a cr simply put the carriage back at the left, column 0. Or you could do a carriage return and a line feed at the same time. It put the carriage at column 0 and went to the next line down.&amp;nbsp; In vb it is vbCrLf. The other things you asked about are &lt;A href="http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-D991386C-FBAA-4094-9FCB-AADD98ACD3EF" target="_blank" rel="noopener"&gt;AutoCAD command macro&lt;/A&gt; characters. A space is equivalent to the user typing {Enter}. The period "." forces the command to use the standard command definition and not one that may have redefined the command. An underscore "_" forces the sequence to not use the localized version where the command options might vary.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:28:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9196443#M5018</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-12-11T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: sendcommand</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9198004#M5019</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;i will learn then about command macros.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 08:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9198004#M5019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-12T08:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: sendcommand</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9198867#M5020</link>
      <description>&lt;P&gt;While&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;provided excellent explanation on string format to be used for SendCommand(), since you said you are new to VBA, I'd suggest to avoid to use SemdCommand() as much as possible in your VBA code. You should use the COM API to do things (i.e. to create your own command in VBA code, if existing built-in command does not fit your immediate need). For example, instead of calling SendCommand "_.-layer M ...." (creating a new layer), you should do&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Set newLayer = ThisDrawing.Layers.Add("newLayerName")&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Of course, before you adding new layer, you can have code to see if a layer with that name already exists...This is the power of writing VBA code with API, simple and easy and you have more control.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, mixing SendCommand() in middle of other VBA code may have unexpected effect, especially if the execution of code following SendCommand() depending on the result of SendCommand().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your goal is to create simple script based on existing commands, learning/using LISP would be better/easier way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 15:03:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9198867#M5020</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2019-12-12T15:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: sendcommand</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9199050#M5021</link>
      <description>&lt;P&gt;thank you very much norman for ur advice and guidance!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendcommand/m-p/9199050#M5021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-12T16:05:38Z</dc:date>
    </item>
  </channel>
</rss>

