。网络清理文件
大家好,我正在寻找编写一个程序,它需要一个绘图并通过清除它和删除所有维度来清理它,我还想将所有图层更改为8色?除了0>>>可怕的对吗?
**** Hidden Message ***** 你看过交易所了吗?
https://apps . exchange . Autodesk . com/ACD/en/List/Search?searchboxstore = ACD & facet = & collection = & sort = date updated % 2c desc & language = en & query = Purge 很酷谢谢 这就是我要找的。
在绘图区域的选择对象下的帮助中找到了它。
现在要弄清楚如何绑定和清除
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
public static void SelectObjectsOnscreen()
{
// Get the current document and database
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
// Start a transaction
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
// Request for objects to be selected in the drawing area
PromptSelectionResult acSSPrompt = acDoc.Editor.GetSelection();
// If the prompt status is OK, objects were selected
if (acSSPrompt.Status == PromptStatus.OK)
{
SelectionSet acSSet = acSSPrompt.Value;
// Step through the objects in the selection set
foreach (SelectedObject acSSObj in acSSet)
{
// Check to make sure a valid SelectedObject object was returned
if (acSSObj != null)
{
// Open the selected object for write
Entity acEnt = acTrans.GetObject(acSSObj.ObjectId,
OpenMode.ForWrite) as Entity;
if (acEnt != null)
{
// Change the object's color to Green
acEnt.ColorIndex = 3;
}
}
}
// Save the new object to the database
acTrans.Commit();
}
// Dispose of the transaction
}
}
页:
[1]