Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to automate the placement and constraining of chain links within assemblies. I've gotten to the point where I can create mate and angle constraints, but I am having trouble turning my angle constraints into undirected angle constraints with limits. If anybody knows the next step, I would be very grateful to learn from you.
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Right now I am just using two component occurances to test
'this iRule. Later on I will add user inputs that loop through
'each link in the chain based on what is required
Dim compOcc1 As ComponentOccurrence = Component.InventorComponent("link:1") Dim compOcc2 As ComponentOccurrence = Component.InventorComponent("link:2") 'This portion creates a mate between two work points.
'It does what I want without any issues '[ Dim oPoint1 As WorkPoint oPoint1 = compOcc1.Definition.WorkPoints("Work Point1") Dim oPoint2 As WorkPoint oPoint2 = compOcc2.Definition.WorkPoints("Work Point2") Dim oproxyPoint1 As WorkPointProxy compOcc1.CreateGeometryProxy(oPoint1, oproxyPoint1) Dim oproxyPoint2 As WorkPointProxy compOcc2.CreateGeometryProxy(oPoint2, oproxyPoint2) Dim oConstraint As MateConstraint oConstraint = oAsmCompDef.Constraints.AddMateConstraint(oproxyPoint1, oproxyPoint2, 0) oConstraint.Name = compOcc1.Name & ":" & compOcc2.Name & " mate" '] 'This is the part I am having trouble with '[ Dim oAxis1 As WorkAxis oAxis1 = compOcc1.Definition.WorkAxes("Z Axis") Dim oAxis2 As WorkAxis oAxis2 = compOcc2.Definition.WorkAxes("Y Axis") Dim oproxyAxis1 As WorkAxisProxy compOcc1.CreateGeometryProxy(oAxis1, oproxyAxis1) Dim oproxyAxis2 As WorkAxisProxy compOcc2.CreateGeometryProxy(oAxis2, oproxyAxis2) Dim oAConstraint As AngleConstraint oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis1, oproxyAxis2, 0,)
'I want to make this constraint undirected with a limit from 0 deg to 30 deg oAConstraint.Name = compOcc1.Name & ":" & compOcc2.Name & " angle 1" ']
Solved! Go to Solution.