06-05-2024
11:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-05-2024
11:12 PM
The easiest way is to define your UCS in assembly and use its transformation to move the component. Below is the relevant part of your code. Everything else stay unchanged.
...
' Set the Translation of the matrix
oMatrix.SetTranslation(oTransientGeometry.CreateVector(Location_X / 10, Location_Y / 10, Location_Z / 10))
' Transform matrix to UCS1
Dim oUcsMatrix As Matrix = oAsmCompDef.UserCoordinateSystems("UCS1").Transformation
oMatrix.PostMultiplyBy(oUcsMatrix)
' Set a reference to the Component Occurrences
Dim oOccurrences As ComponentOccurrences = oAsmCompDef.Occurrences
...