PPT_LOGO_4b
‹#›
© 2008 Autodesk
Autodesk Developer Network
§Similar to AutoCAD entities – TestWallAdd command
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§
§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)
Object Creation
Aec Entities
How to create new Aec entities? Similar to standard AutoCAD.NET: create the object, define its properties, add it to model space, and add it to the transaction.