Inventor Customization

Inventor Customization

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

How to change Angle Constraint in Assembly?

347 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,335
Registered: ‎06-12-2011
Message 2 of 2 (318 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.