kdub 发表于 2022-5-10 01:45:22

制作或获取并设置布局

**** Hidden Message *****

gile 发表于 2022-5-10 02:03:16

谢谢吉尔。
这肯定会清理它
赞赏!
补充:我开始玩这个是因为在其他地方有一个问题,Layout1数据被删除了。

kdub 发表于 2022-5-10 02:06:30

已更新:    。
版权所有2022 CodeHimBelonga:kdub 2022/05/10 。
//。
使用Autodesk,应用服务;。
使用Autodesk,AutoCAD . DatabaseServices。
使用Autodesk,AutoCAD . Runtime。

使用Kdub,常见;。
使用AcadApp = Autodesk,AutoCAD . application services . core . application;。



命名空间布局类。
{。
公共类LayoutClass。
{。

公共静态void MakeLayout()。
{。
ObjectId layout id = create layout(" layout 3 ");。
}。

私有静态ObjectId create layout(string layout name)。
{。
ObjectId layoutId。
var layoutMgr = LayoutManager,当前;。
if (layoutMgr,LayoutExists(layoutName))。
{。
layoutId = layoutMgr,GetLayoutId(layout name);。
}。
否则。
{。
layoutId = layoutMgr,create layout(layout name);。
}。
layoutMgr,CurrentLayout = layoutName。
返回layoutId。
}。
}。
}。
页: [1]
查看完整版本: 制作或获取并设置布局