2015-07-03 53 views

回答

1

如果你想開始與AutoCAD編程,檢查www.autodesk.com/myfirstautocadplugin

但我必須說,AutoCAD的不理解「房子」的概念,因爲我們做的,它僅包含該行我們讀爲房屋(或其他)。

的Revit更好地理解它,有牆,房間,空間的清晰概念等

EDITED

這裏是一個C#樣品總和封閉折線的總面積(2D輕質)

[CommandMethod("countPlineArea")] 
public static void CmdCountPlineArea() 
{ 
    double totalArea = 0.0; 

    Database db = Application.DocumentManager.MdiActiveDocument.Database; 
    using (Transaction trans = db.TransactionManager.StartTransaction()) 
    { 
    BlockTableRecord currentSpace = trans.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord; 
    foreach(ObjectId entId in currentSpace) 
    { 
     if (entId.ObjectClass != RXClass.GetClass(typeof(Polyline))) continue; 
     Polyline pline = trans.GetObject(entId, OpenMode.ForRead) as Polyline; 
     if (!pline.Closed) continue; // no area 
     totalArea += pline.Area; 
    } 
    } 
} 
+0

謝謝您的重播。我已閱讀www.autodesk.com/myfirstautocadplugin上的教程並獲得了一些見解。請與我分享任何額外的資源和免費插件。我想讀取圖形文件,識別每個對象類型(如折線)並計算總面積。 –

+1

太棒了,請在http://images.autodesk.com/adsk/files/autocad2016_dot_net_training.zip上進行完整培訓,並查看博客http://adndevblog.typepad.com/autocad/ –