.NET

Reply
Contributor
csharpbird
Posts: 13
Registered: ‎06-09-2009
Message 1 of 2 (160 Views)

How to change a dimensional constraint from annotational to dynamic?

160 Views, 1 Replies
06-12-2012 08:21 AM
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?

ADN Support Specialist
philippe.leefsma
Posts: 581
Registered: ‎06-02-2009
Message 2 of 2 (126 Views)

Re: How to change a dimensional constraint from annotational to dynamic?

07-31-2012 02:24 AM in reply to: csharpbird

Hi 

 

This setting is not exposed through this high level constraint API.

 

In order to set a constraint dynamic, you need to use the "AcDbDimension::setConstraintDynamic(true)" on the dimension on which you apply the constraint. You will need to modify the source code of the C++ API in order to achieve that.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community