Page 1 of 1

Performance Test Macro?

Posted: Wed May 17, 2023 1:07 pm
by MJuric
Are there any macro's or example of macros that do some number of operations with existing models and tracks performance?

I've seen something like this from some hardware companies and I tried...and failed, to write one for myself.

I'd like to be open a file, do something to it, copy, array, move, delete parts, insert parts, rotate, section etc etc and then measure time it takes to do the entire thing.

Re: Performance Test Macro?

Posted: Wed May 17, 2023 1:11 pm
by AlexB
There's built in performance testing in Solidworks Rx on the benchmark tab that does exactly this.
image.png

Re: Performance Test Macro?

Posted: Wed May 17, 2023 1:24 pm
by MJuric
AlexB wrote: Wed May 17, 2023 1:11 pm There's built in performance testing in Solidworks Rx on the benchmark tab that does exactly this.

image.png
I'm aware of that. I want to specifically use our models and use operations that we do/use most often. Not only do I want to use it to compare machine performances but I also want to use it to test "Modeling practices" and effect on performance.

Re: Performance Test Macro?

Posted: Wed May 17, 2023 3:08 pm
by TTevolve
Just hit the record macro button, go through he steps to create something and then save it. Only thing you would have to add would be the timer function, but you could do that by stop watch. You might want to have a list of steps if your making a more complicated model.

I did something similar a while back, I took a large assembly and opened it on an older machine and then on a newer machine. Based on the time just to open and/or save the file you would gain around a 30% to 40% speed increase (I think this was back in SW 2016) with newer hardware. I did this to show that we could ROI on the cost of a new upgraded PC in 6 to 6 months time frame. We switched to upgrading all our engineering PC's every 4 years.

Re: Performance Test Macro?

Posted: Wed May 17, 2023 5:18 pm
by Frederick_Law
Get current time before and after run in macro. No timer required.
Record might not record everything but could give you something to start.

Re: Performance Test Macro?

Posted: Thu May 18, 2023 8:16 am
by MJuric
TTevolve wrote: Wed May 17, 2023 3:08 pm Just hit the record macro button, go through he steps to create something and then save it. ....
I tried this a while back but I ran into enough issues that didn't work that it just didn't seem to be the right approach.

I will look at this again and try it and report back on the problems I have. I believe it was not doing any sort of manipulation(rotating part) correctly and then was also not doing some things, arrays etc.

When I looked at the macro it was a big enough mess that I just gave up.

Thank You

Re: Performance Test Macro?

Posted: Thu May 18, 2023 8:25 am
by SPerman
I have had very little luck using "record macro." It records some things, but misses the majority of operations.

Re: Performance Test Macro?

Posted: Thu May 18, 2023 8:30 am
by AlexB
SPerman wrote: Thu May 18, 2023 8:25 am I have had very little luck using "record macro." It records some things, but misses the majority of operations.
Recording a macro almost always results in unusable code that doesn't capture most of what the user is doing. It gives insight to some operations, but 99% of cases require someone with API knowledge to go in and make it do what it missed. And that can be cumbersome.

Re: Performance Test Macro?

Posted: Thu May 18, 2023 9:38 am
by MJuric
AlexB wrote: Thu May 18, 2023 8:30 am Recording a macro almost always results in unusable code that doesn't capture most of what the user is doing. It gives insight to some operations, but 99% of cases require someone with API knowledge to go in and make it do what it missed. And that can be cumbersome.
Which was my experience exactly. When I looked at the macro itself it looked absolutely horrific and appeared to be such a mess that "fixing" it would have been more of a project than writing it from scratch. At least that's what it looked like from my very limited experience perspective.

Re: Performance Test Macro?

Posted: Thu May 18, 2023 1:15 pm
by josh
I wrote a benchmark for a guy once. It's certainly possible but not quite as simple as recording (as you found out). If you feel like it would be of value to have a custom benchmark, feel free to drop me a DM. I enjoy writing SW stuff so I work pretty cheap.