4 Replies Latest reply on Nov 27, 2012 9:44 AM by Luc St-Pierre

# How to change angle mate without changing minimum and maximum values

Hi!

I have just started using SolidWorks 2011 and I am developping an add-in using the API. So I am fairly new to all of this.

Here it is : I have an assembly that I did not create myself. There is a component that has mates in a way that it can only rotate around one axis. Minimum and maximum angles are defined with an angle mate. My goal is to replicate programmatically this component's rotation as if the user changed the angle value in mate's Property Manager, therefore the component is rotated accordingly to its angle mate.

In my code, I found the angle mate I was looking for and I changed the angle using ISetValue3 on its Dimension object (which is in its IDisplayDimension object). That did not work well. The angle value is changed correctly in the mate's Property Manager, but the minimum and maximum angles are changed as well. I do not understand why. Also, I do not understand the purpose of maximum and minimum variation values found in the Limit Dimension linked to this angle mate. Am I using the correct method to achieve my goal?

• ###### Re: How to change angle mate without changing minimum and maximum values

You can use AssemblyDoc::EditMate2 and reassign the limits. Read the limits via Mate2::MaximumVariation/Mate2::MinimumVariation.

______________________

Regards,

Artem Taturevych

Application Engineer at Intercad

Tel: +61 2 9454 4444

• ###### Re: How to change angle mate without changing minimum and maximum values

Thank you, EditMate2 worked. Is there a way to programmatically change the minimum and maximal values of an angle/distance mate? Or is changing the values via EditMate2 the only way? I am wondering since we can both change the mate's minimal and maximal values and change the dimension's minimal and maximal variation with Solidworks' user interface.

• ###### Re: How to change angle mate without changing minimum and maximum values

You still can work with the mate dimension directly. The minimum and maximum variations are treat as limit tolerance.

So, you can access the tolerance via:

IDisplayDimension::GetDimension2->IDimension::Tolerance

check the type:

DimensionTolerance::Type = swTolLIMIT

and set the minimum and maximum values:

DimensionTolerance::SetValues.

______________________

Regards,

Artem Taturevych

Application Engineer at Intercad