Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change Angle Constraint in Assembly?

1 REPLY 1
Reply
Message 1 of 2
Articles
737 Views, 1 Reply

How to change Angle Constraint in Assembly?

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?

1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: Articles

Hi,

 

to drive assembly constraint, you need to use the methods of DriveConstraintSettings. Please refer to this post:

http://forums.autodesk.com/t5/Autodesk-Inventor/Angle-Constraint-Drive-Constraint-Issues/td-p/355863...

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

Post to forums  

Autodesk Design & Make Report