' 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)