fzlong 发表于 2025-6-26 12:06:57

谢谢分享,正好需要

uvyx 发表于 2025-7-18 18:39:12

本帖最后由 uvyx 于 2025-7-18 19:19 编辑

当前上下文中不存在名称“Acap” "ForEach"

箭头_Row 发表于 2025-7-18 23:55:50

uvyx 发表于 2025-7-18 18:39
当前上下文中不存在名称“Acap” "ForEach"

//
// 摘要:
//   Enumerates for each in this collection.
//
// 参数:
//   this:
//   The @this to act on.
//
//   action:
//   The action.
//
// 类型参数:
//   T:
//   Generic type parameter.
//
// 返回结果:
//   An enumerator that allows foreach to be used to process for each in this collection.
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T> action)
{
   T[] array = @this.ToArray();
   T[] array2 = array;
   foreach (T obj in array2)
   {
         action(obj);
   }

   return array;
}

//
// 摘要:
//   Enumerates for each in this collection.
//
// 参数:
//   this:
//   The @this to act on.
//
//   action:
//   The action.
//
// 类型参数:
//   T:
//   Generic type parameter.
//
// 返回结果:
//   An enumerator that allows foreach to be used to process for each in this collection.
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T, int> action)
{
   T[] array = @this.ToArray();
   for (int i = 0; i < array.Length; i++)
   {
         action(array, i);
   }

   return array;
}

global using Acap = Autodesk.AutoCAD.ApplicationServices.Application;

global using Acaop = Autodesk.AutoCAD.ApplicationServices.Core.Application;



zjy2999 发表于 2025-9-26 09:24:18

感谢楼主,参考楼主的代码,这是使用vs2017,c#语言net4.5,在autocad2016使用的编译的dll文件和menu.xml文件,压缩包,使用netload命令加载,侧边栏显示命令是“rr”

zjy2999 发表于 2025-9-26 09:30:35

显示侧边栏前,可以修改menu.xml文件,添加或修改cad命令,使用要求:menu.xml一定和dll文件位于统一目录。这是源码。

yanshengjiang 发表于 2025-10-16 19:11:00

zjy2999 发表于 2025-9-26 09:30
显示侧边栏前,可以修改menu.xml文件,添加或修改cad命令,使用要求:menu.xml一定和dll文件位于统一目录。 ...

不知道为什么我这加载出来也没菜单。 放在一个目录的

s623187470 发表于 2025-11-25 09:31:37

谢谢大佬分享

haisensy 发表于 2025-11-26 20:55:53

感谢分享。

行天下 发表于 2025-11-27 08:39:06

zjy2999 发表于 2025-9-26 09:24
感谢楼主,参考楼主的代码,这是使用vs2017,c#语言net4.5,在autocad2016使用的编译的dll文件和menu.xml文件 ...

2024加载出来没有命令是什么问题呢,面板就是空白

zjy2999 发表于 2025-11-27 11:33:46

以前发的编译的侧边栏可能错误,重新发,autocad2016可以使用
页: 1 2 3 [4] 5
查看完整版本: 最少代码的侧边栏菜单