How can rotate and translate a component at the same time ?

I have written VB code using the Solidworks API and Drag operator.

My goal is to move a component round a curved part. However, it does not move as it should.

I have defined a Maths transform that includes both a rotation and transformation. However, we I run the program it moves the component but the rotation is not round the axis I set. Instead it rotates around the assembly origin (0, 0, 0)

I have checked the solidworks help on using the Mathtransform object and I have successfully used

Set swXform = swMathUtil.CreateTransformRotateAxis(Rot_Origin, Rot_Axis, Rad_Angle)

which rotates a component around a given origin.

I have also used the object below to translate objects

Set swXform = swMathUtil.CreateTransform((v3Dform))

How can I use these combinations of objects and APIs to create a move that both translates and rotates an object around a origin different from the Assembly origin (0,0,0)?

Reply to
Mike Domingue
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.