<?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 acedInvoke in VB .NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/acedinvoke-in-vb-net/m-p/1579943#M82395</link>
    <description>Hello,&lt;BR /&gt;
can anyone please tell how to use the command 'acedInvoke' from VB .NET. I found a lot of examples for #Sharp, but I am not able to translate it to VB .NET.&lt;BR /&gt;
By the way, is this the only method to call a command from a modal dialog?&lt;BR /&gt;
Regards, Jan</description>
    <pubDate>Tue, 14 Mar 2006 07:55:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-03-14T07:55:19Z</dc:date>
    <item>
      <title>acedInvoke in VB .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/acedinvoke-in-vb-net/m-p/1579943#M82395</link>
      <description>Hello,&lt;BR /&gt;
can anyone please tell how to use the command 'acedInvoke' from VB .NET. I found a lot of examples for #Sharp, but I am not able to translate it to VB .NET.&lt;BR /&gt;
By the way, is this the only method to call a command from a modal dialog?&lt;BR /&gt;
Regards, Jan</description>
      <pubDate>Tue, 14 Mar 2006 07:55:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acedinvoke-in-vb-net/m-p/1579943#M82395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-03-14T07:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: acedInvoke in VB .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/acedinvoke-in-vb-net/m-p/1579944#M82396</link>
      <description>courtesy of http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx&lt;BR /&gt;
&lt;BR /&gt;
Imports System &lt;BR /&gt;
Imports System.Runtime.InteropServices &lt;BR /&gt;
Imports Autodesk.AutoCAD.ApplicationServices &lt;BR /&gt;
Imports Autodesk.AutoCAD.Geometry &lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices &lt;BR /&gt;
Imports Autodesk.AutoCAD.EditorInput &lt;BR /&gt;
Imports AcadApp = Autodesk.AutoCAD.ApplicationServices.Application &lt;BR /&gt;
&lt;BR /&gt;
Public Class Commands &lt;BR /&gt;
&lt;BR /&gt;
 Sub New() &lt;BR /&gt;
 End Sub &lt;BR /&gt;
 Const RTSTR As Short = 5005 &lt;BR /&gt;
 Const RTNORM As Short = 5100 &lt;BR /&gt;
 Const RTNONE As Short = 5000 &lt;BR /&gt;
 Const RTREAL As Short = 5001 &lt;BR /&gt;
 Const RT3DPOINT As Short = 5009 &lt;BR /&gt;
 Const RTLONG As Short = 5010 &lt;BR /&gt;
 Const RTSHORT As Short = 5003 &lt;BR /&gt;
 Const RTENAME As Short = 5006 &lt;BR /&gt;
&lt;BR /&gt;
 &lt;SYSTEM.SECURITY.SUPPRESSUNMANAGEDCODESECURITY&gt; _ &lt;BR /&gt;
 &lt;DLLIMPORT&gt; _ &lt;BR /&gt;
 Shared Function acedCmd(ByVal resbuf As IntPtr) As Integer &lt;BR /&gt;
 End Function &lt;BR /&gt;
&lt;BR /&gt;
 Public Shared Function Command(ByRef ParamArray args As Object()) As Integer &lt;BR /&gt;
   If AcadApp.DocumentManager.IsApplicationContext Then &lt;BR /&gt;
     Return 0 &lt;BR /&gt;
   End If &lt;BR /&gt;
   Dim res As Integer = 0 &lt;BR /&gt;
   Dim cnt As Integer = 0 &lt;BR /&gt;
   ' Using &lt;BR /&gt;
   Dim buffer As ResultBuffer = New ResultBuffer &lt;BR /&gt;
   Try &lt;BR /&gt;
     For Each o As Object In args &lt;BR /&gt;
       Dim code As Integer = 0 &lt;BR /&gt;
       If TypeOf o Is String Then &lt;BR /&gt;
         code = RTSTR &lt;BR /&gt;
       Else &lt;BR /&gt;
         If TypeOf o Is Int32 Then &lt;BR /&gt;
           code = RTLONG &lt;BR /&gt;
         Else &lt;BR /&gt;
           If TypeOf o Is Int16 Then &lt;BR /&gt;
             code = RTSHORT &lt;BR /&gt;
           Else &lt;BR /&gt;
             If TypeOf o Is Double Then &lt;BR /&gt;
               code = RTREAL &lt;BR /&gt;
             Else &lt;BR /&gt;
               If TypeOf o Is Point3d Then &lt;BR /&gt;
                 code = RT3DPOINT &lt;BR /&gt;
               Else &lt;BR /&gt;
                 If TypeOf o Is ObjectId Then &lt;BR /&gt;
                   code = RTENAME &lt;BR /&gt;
                 End If &lt;BR /&gt;
               End If &lt;BR /&gt;
             End If &lt;BR /&gt;
           End If &lt;BR /&gt;
         End If &lt;BR /&gt;
       End If &lt;BR /&gt;
       If Not (code = 0) Then &lt;BR /&gt;
         buffer.Add(New TypedValue(code, o)) &lt;BR /&gt;
         System.Threading.Interlocked.Increment(cnt) &lt;BR /&gt;
       End If &lt;BR /&gt;
     Next &lt;BR /&gt;
     If cnt &amp;gt; 0 Then &lt;BR /&gt;
       Dim cmdecho As Object = AcadApp.GetSystemVariable("CMDECHO") &lt;BR /&gt;
       AcadApp.SetSystemVariable("CMDECHO", 0) &lt;BR /&gt;
       res = acedCmd(buffer.UnmanagedObject) &lt;BR /&gt;
       AcadApp.SetSystemVariable("CMDECHO", cmdecho) &lt;BR /&gt;
     End If &lt;BR /&gt;
   Finally &lt;BR /&gt;
     CType(buffer, IDisposable).Dispose() &lt;BR /&gt;
   End Try &lt;BR /&gt;
   Return res &lt;BR /&gt;
 End Function &lt;BR /&gt;
&lt;BR /&gt;
 Public Shared Function ZoomExtents() As Integer &lt;BR /&gt;
   Return Command("._ZOOM", "_E") &lt;BR /&gt;
 End Function &lt;BR /&gt;
End Class&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;JAN1&gt; wrote in message news:5110049@discussion.autodesk.com...&lt;BR /&gt;
Hello,&lt;BR /&gt;
can anyone please tell how to use the command 'acedInvoke' from VB .NET. I found a lot of examples for #Sharp, but I am not able to translate it to VB .NET.&lt;BR /&gt;
By the way, is this the only method to call a command from a modal dialog?&lt;BR /&gt;
Regards, Jan&lt;/JAN1&gt;&lt;/DLLIMPORT&gt;&lt;/SYSTEM.SECURITY.SUPPRESSUNMANAGEDCODESECURITY&gt;</description>
      <pubDate>Tue, 14 Mar 2006 19:07:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acedinvoke-in-vb-net/m-p/1579944#M82396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-03-14T19:07:04Z</dc:date>
    </item>
  </channel>
</rss>

