I certainly wouldn't leave the part unconstrained (i.e. deleting the constraint)--that's just asking for problems. There are a number of ways this could be done:
- Create parameters for the constraint offsets, then use iLogic to control the parameter values for each configuration.
- Use iLogic to edit the constraints--change their offset expressions / formulas, change their references, etc.
- Set up a set of constraints for each configuration and use iLogic to suppress & unsuppress constraints (Edit: what MechMachineMan said)
- Create positional representations for each config, use iLogic to set the positional rep.
- Create workplanes / axes / points in your parts and subassemblies, constrain to this work geometry
- Other less-savory methods like you mentioned...
Cameron Whetten
Inventor 2014
Are all of the cars the same length? If so, then a simple parameter formula should do the trick--no iLogic necessary.
Cameron Whetten
Inventor 2014
You say it "may make two turns". Does that mean that the number of turns can vary? As in, it could be either 0, 1, or 2 turns?
If so, then we're back to iLogic, but I'm still thinking parameter formulas will work. But, instead of a single formula, iLogic will choose between 3 or so formulas.
Can you provide any more specific information? I might be able to work up an example, but each time you post, you give new information ... So, if I did an example now, it might not be useful to you if I am missing more of the puzzle.
Do you have any example files or screenshots you can provide? How about a list of the different variables?
Cameron Whetten
Inventor 2014
I don't see any attachments. Sometimes they don't work correctly. Try it again, or just insert the image into your message, like this:
Cameron Whetten
Inventor 2014
I have attached a simplified example of how I might do it (based on the information you have given so far). This is using iLogic to turn off and on patterns of components (the trains of cars), and to turn off and on constraints.
The bumper part is constrained to each of 5 workpoints. The workpoints are created from a curve-driven pattern in the Path Sketches.ipt part file. The curve pattern keeps the workpoints always at the end of the train of cars, regardless of changes to the CarLength, CarSpacing, xLength, zLength, or ArcRadius parameters.
The patterns of cars are feature-driven component patterns. The feature patterns they are driven by are in the Path Sketches.ipt part file, and these feature patterns are also curve-driven, similar to the way the workpoints are created.
The attached files are version 2014.
Out of curiosity, what are you designing?
Cameron Whetten
Inventor 2014
Thank you for sharing this with me!!
It's actually a project for work so I can't exactly say what it is.
I already created the line of cars which use parameters generated in excel using VBA. When I open up your file and look at how the bumper is constrained I see that train1-train5 show the same work point for all. Will this method work if I constrained the cars a different way and the number of cars varies? I posted a comments ago that number of cars vary. I have a line of around 500 cars and I wrote some ilogic that would turn off the visibility of the cars I dont need. So I have a line of 300 cars then the program turns off 200 cars.
Without seeing exactly how your design is set up, all I can do is make guesses and show simplified examples.
In the assembly I posted, the number of cars changes based on the parameters xLength, zLength, CarLength, and CarSpacing. It adjusts the number of cars to be evenly spaced along the given path. So, the bumper part automatically adjusts to the number of cars.
If your parameters are set up differently, the general concept should still work: the parameter formulas control the workpoint locations for each path, and the iLogic controls which workpoint the bumper is constrained to.
I should have mentioned in my previous post that if you open the assembly parameters, you can change the value of the Configuration parameter to see the line of cars change path, and the bumper follows to always attach to the last car.
Cameron Whetten
Inventor 2014
I'm sorry I can't give you more information...
'Code that places the bumper Sub Main() Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition ' Get references to the two occurrences to constrain. ' This arbitrarily gets the first and second occurrence. Dim oOcc1 As ComponentOccurrence oOcc1 = oAsmCompDef.Occurrences.Item(Car) Dim oOcc2 As ComponentOccurrence oOcc2 = oAsmCompDef.Occurrences.Item(Bumper) Dim oPartPoint1 As WorkPoint oPartPoint1 = oOcc1.Definition.WorkPoints.Item(1) Dim oPartPoint2 As WorkPoint oPartPoint2 = oOcc2.Definition.WorkPoints.Item(1) Dim oPartPlaneXY As WorkPlane oPartPlaneXY = oOcc1.Definition.WorkPlanes(3) Dim oPart2PlaneXY As WorkPlane oPart2PlaneXY = oOcc2.Definition.WorkPlanes(3) Dim oAsmPoint1 As WorkPointProxy Call oOcc1.CreateGeometryProxy(oPartPoint1, oAsmPoint1) Dim oAsmPoint2 As WorkPointProxy Call oOcc2.CreateGeometryProxy(oPartPoint2, oAsmPoint2) Dim oPartPlane1 As WorkPlaneProxy Call oOcc1.CreateGeometryProxy(oPartPlaneXY, oPartPlane1) Dim oPart2Plane1 As WorkPlaneProxy Call oOcc2.CreateGeometryProxy(oPart2PlaneXY, oPart2Plane1) ' Create the constraint using the work point proxies. Call oAsmCompDef.Constraints.AddMateConstraint(oAsmPoint1, oAsmPoint2, 0) Call oAsmCompDef.Constraints.AddMateConstraint(oPartPlane1, oPart2Plane1, 0) End Sub
This is the code that I am using currently to place the bumper. It creates a new constraint every time the code is ran. I dont know how to just change what it's constrained to rather than creating a brand new one.
Maybe I could possibly create another iLogic rule to delete the previously created constraint then add it to the iTrigger so when I run the iTrigger it will first delete the previously made constraint then create the new one. The bumper will always be constrained to a car. Think it will work? I’m currently searching for the logic to programmatically delete a constraint. The constraints always have the same label.
Can't find what you're looking for? Ask the community or share your knowledge.