2 Replies Latest reply on Apr 23, 2015 9:18 PM by Michael Deng

    Move a component

    Michael Deng

      Hi , guys.

       

      Are there any APIs can be used to move a component in Assembly ?

        • Re: Move a component
          Keith Rice

          I am assuming you want to move the component but don't want to actually create a mate. In that case:

           

          1. Add a mate with positioning only using IAssemblyDoc::AddMateX, where X => 3. The "ForPositioningOnly" argument is toward the end.

           

          2. Use component transforms. Check out IMathTransform examples in the API Help. These are complicated to use, however, so I'll note that on my web site I do have Lesson 5.3, available to premium subscribers, that walks through step by step how to use these transforms.

           

          Moving components using transforms very high performance compared to adding mates. If performance isn't a major concern and this isn't a serious project then you might just stick with suggestion #1.

           

          Keith

          SolidWorks API Training