Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I found really nice and useful piece of code that sets the offset of components to zero and ground them. I am now trying to change it to do it only for one part in assembly (that I specifically choose in code). So for example, do this only for component "123A:1". And I am failing miserably so far. Does anyone know?
Original code:
Dim doc As AssemblyDocument doc = ThisApplication.ActiveDocument Dim tr As TransientGeometry tr = ThisApplication.TransientGeometry Dim occ As ComponentOccurrence For Each occ In doc.ComponentDefinition.Occurrences ' If it's suppressed we cannot do ' anything with it If Not occ.Suppressed Then Call occ.SetTransformWithoutConstraints( _ tr.CreateMatrix()) occ.Grounded = True End If Next
Solved! Go to Solution.