Hickoz_bro Posted May 21, 2011 Share Posted May 21, 2011 Hi all, Just started playing with Solidworks VBA for the first time, and I'm a bit miffed about this problem. After running this bit of code from the Solidworks Help. I've reached the break on 'End Sub' and the screenshot below shows what I'm getting. All variables are showing Value = 0, nothing or Empty... I ran the code on a file that should have returned LOTS of values show up. I've also tried a few other bits of code, but I can't get anything to show up... Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
Hickoz_bro Posted May 25, 2011 Author Share Posted May 25, 2011 Anyone???? Quote Link to comment Share on other sites More sharing options...
Organic Posted May 25, 2011 Share Posted May 25, 2011 I don't have solidWorks so can't try it, although from the code there and my knowledge of VBA I don't see anything seriously wrong. A test: In the first for statement put in an if statement to start a break when you know it will be running and see whether it works. Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 25, 2011 Share Posted May 25, 2011 Try putting a break point on this line: Set swFeature = swFeature.GetNextFeature Then you should see variable values for each swFeature as you loop thro them. Try using the Step Into button to step thro your code and watch how the variable values change in the Local Pane. Abreak point on END SUB will not return anything because you've looped thro until swFeature is nothing, hence the empty variables. Quote Link to comment Share on other sites More sharing options...
Hickoz_bro Posted May 25, 2011 Author Share Posted May 25, 2011 Here is 2 more screenshots showing the most simple code, and what I'm seeing (or not seeing) in the locals window. First is Solidworks, showing nothing in the locals window. Next is MSExcel showing everything in the locals window. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.