.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change a dimensional constraint from annotational to dynamic?

1 REPLY 1
Reply
Message 1 of 2
csharpbird
384 Views, 1 Reply

How to change a dimensional constraint from annotational to dynamic?

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?

1 REPLY 1
Message 2 of 2

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost