Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I've got Component A in my assembly, which i want to rotate x degrees around it's own Y-Axis. I found the following which i think need
oCurrentOccurrence.Transformation.SetToRotation()
As input i need the the angle of rotation(variable), a workaxis(Y-axis of component), and a point (not sure what the point is for). I found a post of @WCrihfield describing i need to create a proxy to acces the components Work-Axis/Point so i did the following:
Dim oCurrentOccurrence As ComponentOccurrence = oACD.Occurrences.Item(5)
Dim oAngle = 90
Dim oPoint As WorkPoint = oCurrentOccurrence.Definition.WorkPoints.Item(1)
Dim oAxis As WorkAxis = oCurrentOccurrence.Definition.WorkAxes.Item(1)
Dim oPointProxy As WorkPointProxy = Nothing
Dim oAxisProxy As WorkAxisProxy = Nothing
oCurrentOccurrence.CreateGeometryProxy(oPoint, oPointProxy)
oCurrentOccurrence.CreateGeometryProxy(oAxis, oAxisProxy)
oCurrentOccurrence.Transformation.SetToRotation(oAngle, oAxis, oPoint)
It throws an error on line 13
NOTES
- Before this the component is placed in the assembly with '.AddUsingiMates' so this means there are contraints applied to the component. Once it is placed these contrains can be ignored.
- To be clear, i need the component to rotate around it's own Y-Axis. NOT the Y-Axis of the assembly.
Solved! Go to Solution.