User Manual - Page 3250

For AUTOCAD 2011.

Loading ...
Loading ...
Loading ...
Implementation of a Bounding Object Rule
To implement a custom bounding object rule, you need to add a new class
that is derived from the SpaceOffsetRulesManager.AecBoundingObjectRule base
class. The new class needs to implement the Apply interface of the base class
and register itself for the object types it should be called for in the constructor
by calling the AecSpaceOffsetRuleBase.RegisterType() base method. The Apply
method of this rule type has the following syntax:
public abstract bool Apply(Autodesk.AutoCAD.DatabaseServices.Ob
jectId 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 AecSpaceOffsetStandardSample
{
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
3194 | Chapter 39 Spaces
Loading ...
Loading ...
Loading ...