Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, can someone please help me with some ilogic. I want a rule that that will create origin flush constraint for any / all parts that I run it on at assembly level. It must have an option to turn Ground at origin on or off in the code. There is a toolbar for this under the productivity tab (Assemble Ribbon), but I would like to map it to a rule / keyboard shortcut.
I found some code that does only the grounded bit, still need it to "Create origin flush constraints".
Sub Main Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oOcc As ComponentOccurrence oOcc = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "SelectPart") oOcc.Grounded = False For Each oConstraint As AssemblyConstraint In oOcc.Constraints oConstraint.Delete Next oOcc.Transformation = ThisApplication.TransientGeometry.CreateMatrix oOcc.Grounded = True End Sub
Solved! Go to Solution.