Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
josh.nieman
495 Views, 6 Replies

Adding constraint via API changes user constraint-setting-default

I've combed through the code in my application to figure out why/how this is happening but to no avail.  Does anyone have any clues or ideas of where to look?

Here's the issue:

 

Before running the code, user has "Default to undirected" checked as below.

joshnieman_0-1680555669588.png


After running a simple application function of mine that adds a fastener automatically, and constrains it appropriately, this box is unchecked.

This is the /only/ methods that call any function related to constraints:

 

HoleConst1 = AsmDef.Constraints.AddMateConstraint2(Z, ScrewHole1, "0",                                                               InferredTypeEnum.kInferredLine,                                                               InferredTypeEnum.kInferredLine,                                                               MateConstraintSolutionTypeEnum.kUndirectedSolutionType)
            FaceConst2 = AsmDef.Constraints.AddFlushConstraint(XY, FastenFace1, MateOffset)

 

 
Once complete, the next time the user opens the Constraint dialog to manually constrain something, the hole-to-hole "default to undirected" is unchecked