Macro to set Imagequality to coarse with Batch+

Programming and macros
User avatar
Eddy Alleman
Posts: 50
Joined: Thu Apr 01, 2021 10:32 am
Answers: 8
Location: Belgium
x 80
x 89
Contact:

Macro to set Imagequality to coarse with Batch+

Unread post by Eddy Alleman »

I just published another macro on Codestack
image.png
image.png (17.5 KiB) Viewed 2384 times
direct link :
https://www.codestack.net/solidworks-ap ... ty-coarse/

I hope you find it useful.
Please let me know if you have any comments/questions.

Eddy
by Eddy Alleman » Thu Aug 26, 2021 11:54 am
Tip to speed things up :
if your files are all in the same folder, you can filter for *.SLDASM only, because of the setting, the parts in there will be affected too.
Go to full post
User avatar
Eddy Alleman
Posts: 50
Joined: Thu Apr 01, 2021 10:32 am
Answers: 8
Location: Belgium
x 80
x 89
Contact:

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Eddy Alleman »

Tip to speed things up :
if your files are all in the same folder, you can filter for *.SLDASM only, because of the setting, the parts in there will be affected too.
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Slasher »

Hello @Eddy Alleman

Thanks for sharing this!
I want this settings to take effect permanently on all parts (meaning I want to also apply a save operation). Is this going to do that?

Here's the topic I started recently about this: viewtopic.php?t=3403
User avatar
AlexLachance
Posts: 2174
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2353
x 2008

Re: Macro to set Imagequality to coarse with Batch+

Unread post by AlexLachance »

Slasher wrote: Mon Apr 29, 2024 1:08 pm Hello @Eddy Alleman

Thanks for sharing this!
I want this settings to take effect permanently on all parts (meaning I want to also apply a save operation). Is this going to do that?

Here's the topic I started recently about this: viewtopic.php?t=3403
Using Batch+, I believe you would achieve what you desire since you should be able to add the 'save command' in the batch processing. I am permitting myself to answer as Eddy hasn't taken a peek at this forum in a little while. It is an option inside the program.

https://cadplus.xarial.com/batch/assembly/
User avatar
Eddy Alleman
Posts: 50
Joined: Thu Apr 01, 2021 10:32 am
Answers: 8
Location: Belgium
x 80
x 89
Contact:

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Eddy Alleman »

Hi Slasher,

thanks @AlexLachance ;-) I'm back, but you are faster

you can use Batch+ for this see the complete article on Codestack:
https://www.codestack.net/solidworks-ap ... ty-coarse/

There is a button to save in the UI for every file you need to be saved:
image.png
image.png (12.24 KiB) Viewed 1929 times
Try out the different button combinations and let us know how it went ;-)

Eddy
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Slasher »

Amazing!
Thank you Eddy for putting this together; I didn't realize it has auto-save capability! Let me give it a try.
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Slasher »

Hi @Eddy Alleman

I installed batch+ and it worked fantastically; thank you! I like how versatile it is; it's much more than just a batch processing software. It even provides a log so you know which files the macro couldn't work on.

I hate to ask this since you already helped me tremendously; but is there a way to modify below macro so that it change to slightly higher tessellation? Right now it's a bit too coarse for my application. Let's say in the image below; if you divide the slider by 5; then somewhere around first one (%20).
https://www.codestack.net/solidworks-ap ... ty-coarse/

User avatar
SPerman
Posts: 2035
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2207
x 1860
Contact:

Re: Macro to set Imagequality to coarse with Batch+

Unread post by SPerman »

Find this line:
'**********************
boolstatus = swModel.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swImageQualityShaded, _
swUserPreferenceOption_e.swDetailingNoOptionSpecified, _
swImageQualityShaded_e.swShadedImageQualityCoarse)
The bottom line is what you care about. You have 3 choices for "swImageQualityShaded_e"

swShadedImageQualityCoarse
swShadedImageQualityFine
swShadedImageQualityCustom

The "Custom" option requires other coding to set the custom value. You could try "Fine" and see how that works for you. That option works the same as "Coarse"
Attachments
image.png
image.png (3.26 KiB) Viewed 1858 times
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Macro to set Imagequality to coarse with Batch+

Unread post by Slasher »

@SPerman

This forum is amazing.

I edited the macro and replaced Coarse with Fine and it ended up around where I wanted; it's perfect now, thank you Sperman!

Post Reply