- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to be able to to change the offset of my flush constraints. The code below is a start. I can retrieve the current offset values of my two constraints and then post them to a text box. But I cannot figure out how to send the data back from the text box when the user changes it.
Dim selSet As SelectSet
selSet = oAssemblyDocument.SelectSet
Dim selSetCount As Integer = 0
selSetCount = selSet.Count
If selSetCount = Nothing Or selSetCount = 0 Then
Beep()
MsgBox("You must select component(s) first.", vbOKOnly, "Error Selecting Components")
Else
If TypeOf selSet.Item(1) Is ComponentOccurrence Then
oOcc = selSet.Item(1)
'are there existing constraints?
If oOcc.Constraints.Count > 0 Then
For j = 1 To oOcc.Constraints.Count
'is there a mating constraint?
If UCase(oOcc.Constraints.Item(j).Name).Contains("FLUSH") = True Then
If j = 1 Then
Constraint1 = oOcc.Constraints.Item(j)
txtOffset1.Text = Math.Round((Constraint1.Offset.Value), 4)
End If
If j = 2 Then
Constraint2 = oOcc.Constraints.Item(j)
txtOffset2.Text = Math.Round((Constraint2.Offset.Value), 4)
End If
End If
Next j
End If
End If
End If
Solved! Go to Solution.