PPT_LOGO_4b
AutoCAD Architecture .NET API ‹#›
Copyright © 2009 Autodesk Inc.
§同添加AutoCAD实体.
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§2a - Aec Basics.cs  TestWallAdd
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§2a - Aec Basics.vb > AcaNetWallAdd command
' Always call two SetXXX methods after NEW
Dim w As New Wall()
w.SetDatabaseDefaults(db) ' this also calls any subSetDatabaseDefaults
w.SetToStandard(db)
w.SetDefaultLayer() ' set the layer according to the layer key
' Set any specific properties, e.g.:
w.Set(pStart, pEnd, Vector3d.ZAxis)
' Add to ModelSpace
Dim bt As BlockTable = _
    CType(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
Dim btr As BlockTableRecord = _
    CType(tr.GetObject(bt(BlockTableRecord.ModelSpace),
    OpenMode.ForWrite), BlockTableRecord)
btr.AppendEntity(w)
' When an object is added to db, we must also let the transaction know:
tr.AddNewlyCreatedDBObject(w, True)
创建建筑构件