Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have written logic that gets a constraint that I want to change the associated dimension of. I am able to find the constraint and the name of the constraint, but I haven't been able to determine how to link the constraint to the parameter that stores the dimension value. What am I missing?
I can see in the Parameters menu that the parameter name is "d1", and that it is consumed by constraint "mate:1", but iLogic seems to act like there is no reasonable bridge linking the parameter and the constraint.
Dim oAssemDoc As AssemblyDocument oAssemDoc = ThisApplication.ActiveDocument Dim oConstraints As AssemblyConstraints oConstraints = oAssemDoc.ComponentDefinition.Constraints Dim oOcc As ComponentOccurrence oOcc = oAssemDoc.ComponentDefinition.Occurrences(2) Dim compConstraints As AssemblyConstraintsEnumerator compConstraints = oOcc.Constraints Dim oConstraint As AssemblyConstraint oConstraint = compConstraints.Item(1) logger.Info(oConstraint.Name) Dim oParams As Parameters oParams = oAssemDoc.ComponentDefinition.Parameters.ModelParameters For Each oParam As ModelParameter In oParams 'Something like If oParam.consumedBy = oConstraint.Name ' oParam.Value = 10 in 'End If Next
Solved! Go to Solution.