5 Replies Latest reply on Jun 23, 2018 10:01 AM by Sean Dalton

    Animating an assembly using VBA

    Sean Dalton

      While I know SolidWorks motion tools are quite powerful in terms of creating a sequence of movement you tend to program a rigid sequence with set start and end positions.

      I would like to 'animate' a SolidWorks assembly using VBA (or at least adjust assembly dimension to create the illusion of motion) thus allowing me access to access the functionality and flexibility of a mainstream programming language. One think I would like to do for example is to animate a pick an place robot based on a set of numbers contained in a text file or obtained from an Excel spreadsheet.

       

      I found a CAD model of a 6 axis robot on line and figured out how to out how to adjust joint angles using VBA. In an effort to 'animate' the movement I have written a loop which allows me to adjust the joint angle incrementally, however the SolidWorks assembly does not update until movement is complete. in other words SolidWorks just jumps to the end position.

      However when I run program step by step (F8) the SolidWorks assembly can be clearly seen to move incrementally.

       

      Any suggestions how I might be able to get the SolidWorks display to update continuously as the joint angle changes. (See attached video)

      The attached shows a model of a 6 axis robot, when I run step by step you can see the robot move incrementally towards the target position, but when I run in normal mode the display it just jumps to the final position without showing any of the intermediate positions. Any suggestions as to how I might be able go get solidworks assembly to update continuously as VBA adjusts the angle.

       

      Sean Dalton