• 大小: 2KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-13
  • 语言: 其他
  • 标签: AutoCAD  2013  InvokeArx  

资源简介

AutoCAD 2013 执行命令 方法

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace ToolPaletteGas
{
    /*   public static class EditorInputExtensionMethods
        {
            public static PromptStatus Command(this Editor editor params object[] args)
            {
                if (editor == null)
                    throw new ArgumentNullException(“editor“);
                return runCommand(editor args);
            }

            static Funcject[] PromptStatus> runCommand = GenerateRunCommand();

            static Funcject[] PromptStatus> GenerateRunCommand()
            {
                MethodInfo method = typeof(Editor).GetMethod(“RunCommand“
                   BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
                var instance = expression.Parameter(typeof(Editor) “instance“);
                var args = expression.Parameter(typeof(object[]) “args“);
                return expression.Lambdaject[] PromptStatus>>(
                   expression.Call(instance method args) instance args)
                      .Compile();
            }
        }
        */
    public static class AboutCMD
    {
        [System.Security.SuppressUnmanagedCodeSecurity]
        [DllImport(“accore.dll“ EntryPoint = “acedCmdS“ CharSet = CharSet.Auto CallingConvention = CallingConvention.Cdecl)]
        extern static private int acedCmdS(IntPtr resbuf);

        public static bool HasCommand = false;
        public static Listject> BufferCommand = new Listject>();
        public const string PauseToken = @“\“;
        private static Hashtable resTypes;//

        /*  public static void RunCommand(bool echoCommand params object[] args)
          {
              Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
              doc.Editor.Command(args);
            

          }
          public static void RunBurrerCommand()
          {
              if (HasCommand == true)
              {
                 
                  Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
                  doc.Editor.Command(BufferCommand.ToArray());
                  
              }

              HasCommand = false;
              BufferCommand.Clear();
          }
         */
        static AboutCMD()
        {
            resTypes = new Hashtable();
            resTypes[typeof(String)] = (int)LispDataType.Text;
            resTypes[typeof(string)] = (short)0x138d;
            resTypes[typeof(double)] = (short)0x1389;
            resTypes[typeof(Point3d)] = (short)0x1391;
            resTypes[typeof(objectId)] = (short)0x138e;
      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        6445  2014-11-17 14:29  InvokeArx.cs
     文件        1787  2014-11-17 18:03  toolsPublicFun.cs

评论

共有 条评论