I got a problem with editing angle constraint in assemblies. I tried edit property of constraint but it didn't move model. Simply changing Angle attribute of constraint item don't work.
Only way I achieved movemenet is
if(oOccurrence.Constraints[i].Name.Equals(name)){ AngleConstraint a = (AngleConstraint)oOccurrence.Constraints[i]; Object oEntity1 = a.EntityOne; Object oEntity2 = a.EntityTwo; String sVal = "" + angle + " deg"; a.Delete(); AngleConstraint d=oAsmCompDef.Constraints.AddAngleConstraint(oEntity1, oEntity2, sVal); d.Name = name; }
but this is really slow, as much as changing throught parameter:
if (assemblyDoc.ComponentDefinition.Parameters[i].Name == "d655")
{
Inventor.Parameter invParam = assemblyDoc.ComponentDefinition.Parameters[i];
invParam.Value = Math.PI * angle/180;
inventorApplication.ActiveDocument.Update();
}
Can someone help me with a quicker method?
Hi,
to drive assembly constraint, you need to use the methods of DriveConstraintSettings. Please refer to this post: