Inventor Customization

Inventor Customization

Reply
New Member
Articles
Posts: 1
Registered: ‎09-17-2012
Message 1 of 2 (331 Views)

How to change Angle Constraint in Assembly?

331 Views, 1 Replies
01-05-2013 02:59 AM

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?

ADN Support Specialist
xiaodong.liang
Posts: 1,307
Registered: ‎06-12-2011
Message 2 of 2 (302 Views)

Re: How to change Angle Constraint in Assembly?

01-13-2013 08:25 PM 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...



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!