public abstract bool Apply(Autodesk.AutoCAD.DatabaseServices.ObjectId idSpace,
Autodesk.AutoCAD.DatabaseServices.ObjectId idObject);
The first argument is the current space for which the offset boundary profile is to be calculated. The second argument
idObject is the Object ID of the object that bounds the space. Within the Apply method, the space object as well as the
bounding object can now be opened and queried for certain properties to decide if this object should contribute to the
generated profile. If the method returns false, the boundaries of the object are removed from the offset profile. This
implies that the object will not be considered anymore when the offset rules are applied. The following example shows
the framework for a new space rule called BoundingObjectRuleGross:
namespace AecSpaceOffsetStandardBasic
{
public class BoundingObjectRuleBasic: AecBoundingObjectRule
{
public BoundingObjectRuleGross()
{
RegisterType(typeof(kAllTypes));
}
public override bool Apply(ObjectId idSpace, ObjectId idObject)
{
//return false to mark object as non-contributing
}
}
}
Sample Bounding Object Rule BoundingObjectRuleGross
The following example shows the bounding object rule implementation used for the gross profile of the sample project.
This rule removes all segments from the profile that are bound by a structural member. This is a common case for
defining the gross area of a space, where structural members are not considered, even if they are bounding the base
profile of the space.
public class BoundingObjectRuleGross : AecBoundingObjectRule
{
public BoundingObjectRuleGross()
{
RegisterType(typeof(kAllTypes));
}
public override bool Apply(ObjectId idSpace, ObjectId idObject)
{
bool result=true;
Autodesk.AutoCAD.DatabaseServices.Database db =idObject.Database;
using (Autodesk.AutoCAD.DatabaseServices.Transaction transaction
=db.TransactionManager.StartTransaction())
{
Member member = transaction.GetObject(idObject, OpenMode.ForRead) as Member;
if ( member == null )
{
MemberType memType = member.MemberType;
if ( memType == MemberType.Column )
{
result = false;
}
}
transaction.Commit();
}
return result;
}
}
The figure below shows an example of applying this rule, where the net boundary (green) includes the columns, while
the gross boundary (blue) ignores them
1756 | Chapter 36 Spaces
Need help?
Do you have a question about the 24108-051400-9000 - AutoCAD Revit Architecture Suite 2008 and is the answer not in the manual?