I am new to VBA coding in general but am interested in getting into it and feel like this code that I am trying to write is a good way for me to learn.
So I have a Solidworks part with various 3d sketches each containing hundreds of points that have been placed and fixed by another macro. The coordinates of each of these points is generated by an excel sheet. The problem is that these excel coordinates get updated/changed frequently, in the past I have been deleting the sketch and replacing the points with the new set of data, this is problematic because we use these points to locate parts in an assembly so everytime there is a change and the sketch is deleted, I have to fix the references. I would like to write a macro that can edit the sketch points that need to change in the existing sketch rather than delete and replace. Hopefully that makes sense
I think the macro steps would be something like this:
User would select the sketch that needs to be modified
The macro would read the coordinates of the first point (55.42679244, 48.29926324, 1200)
Select the point by the read in coordinates
unfix the points
Set the point to the new coordinates (55.42679, 48.29946, 1300)
fix the point
move on the the next point and repeat
I realize this may seem simple and I dont have a lot to start with. I've tried recording a few macros and read other forums to figure out how this could be done.
My first questions might be, how do I get SW to select a point by location? and what is the best way to cycle through all the points in the excel sheet?
Any thoughts or help would be great. Thanks!