04-20-2020
02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-20-2020
02:51 AM
Hi @jamieking89
Happy to help!
You can do that but it's much more complex. Try the iLogic code below. You'll have to make a constraint and name it
Plate_Constraint in which the first entity in the constraint is "Top_of_pipe_plane" and the second is one of the planes from your parts.
You should have the same event trigger as before.
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oConstraint As MateConstraint = oDoc.ComponentDefinition.Constraints.Item("Plate_Constraint") Dim oPlaneProx1 As WorkPlaneProxy = Nothing Dim oPlaneProx2 As WorkPlaneProxy = Nothing Dim oPlate1 As ComponentOccurrence = oDoc.ComponentDefinition.Occurrences.ItemByName("Plate1:1") Dim oPlate2 As ComponentOccurrence = oDoc.ComponentDefinition.Occurrences.ItemByName("Plate2:1") If Component.IsActive("Plate1:1") = True And Component.IsActive("Plate2:1") = False Call oPlate1.CreateGeometryProxy(oPlate1.Definition.WorkPlanes.Item("Plate1_face_plane"), oPlaneProx1) oConstraint.ConvertToMateConstraint(oConstraint.EntityOne, oPlaneProx1, oConstraint.Offset.Value) ElseIf Component.IsActive("Plate1:1") = False And Component.IsActive("Plate2:1") = True Call oPlate2.CreateGeometryProxy(oPlate2.Definition.WorkPlanes.Item("Plate2_face_plane"), oPlaneProx2) oConstraint.ConvertToMateConstraint(oConstraint.EntityOne, oPlaneProx2, oConstraint.Offset.Value) Else Exit Sub End If oConstraint.Name = "Plate_Constraint" ThisDoc.Document.Rebuild
See attached file ![]()
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website