public class DimConstraints
{
[CommandMethod("Test")]
public void Test()
{
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
Circle circle = new Circle { Center = Point3d.Origin, Radius = 10 };
ObjectId modelId = SymbolUtilityServices.GetBlockModelSpaceId(db);
BlockTableRecord model = (BlockTableRecord)modelId.GetObject(OpenMode.ForWrite);
model.AppendEntity(circle);
trans.AddNewlyCreatedDBObject(circle, true);
AssocUtil.CreateRadialDimConstraint(circle.ObjectId, circle.StartPoint, circle.StartPoint);
trans.Commit();
}
}
}
The above codes use the simplified .NET API for accessing AutoCAD parameters and constraints from:
http://through-the-interface.typepad.com/files/AdnAssocConstraintAPI.zip
The above codes can create a radial dimensional constraint.
But the type of the dimensional constraint is annotational.
How to change it to a dynamic constraint?