谢谢分享,正好需要
本帖最后由 uvyx 于 2025-7-18 19:19 编辑
当前上下文中不存在名称“Acap” "ForEach"
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;
感谢楼主,参考楼主的代码,这是使用vs2017,c#语言net4.5,在autocad2016使用的编译的dll文件和menu.xml文件,压缩包,使用netload命令加载,侧边栏显示命令是“rr”
显示侧边栏前,可以修改menu.xml文件,添加或修改cad命令,使用要求:menu.xml一定和dll文件位于统一目录。这是源码。
zjy2999 发表于 2025-9-26 09:30
显示侧边栏前,可以修改menu.xml文件,添加或修改cad命令,使用要求:menu.xml一定和dll文件位于统一目录。 ...
不知道为什么我这加载出来也没菜单。 放在一个目录的
谢谢大佬分享
感谢分享。
zjy2999 发表于 2025-9-26 09:24
感谢楼主,参考楼主的代码,这是使用vs2017,c#语言net4.5,在autocad2016使用的编译的dll文件和menu.xml文件 ...
2024加载出来没有命令是什么问题呢,面板就是空白
以前发的编译的侧边栏可能错误,重新发,autocad2016可以使用