Setting Image Quality For All Parts in an Assembly

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

Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

Hello all;

I have a large assembly and I want to set image quality of all its components to an exact value in settings. There are macros out there to achieve that.

My question: Do I have to check-out all the components (i.e. have write-access) before running such a macro in order for this to take effect permanently? Are there better workarounds for this?

Thank you;
User avatar
gupta9665
Posts: 405
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 426
x 445

Re: Setting Image Quality For All Parts in an Assembly

Unread post by gupta9665 »

Yes you need to have write access to the files as you will be changing and then saving the files.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Setting Image Quality For All Parts in an Assembly

Unread post by mp3-250 »

we face a similar issue with our vault. image quality is a per document property, so you have to save it with the file. you could have it temporary set without saving if the file is fully loaded (i.e. has its own window open inside solidworks), but you can do it for a limited amount of data (less than 50 files iirc ) as solidwotks will go out of memory.

this is one of the reasons to set a conpany standard (e.g. same image quality when adding a new catalog part to the vault)
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

@mp3-250
Thanks; that makes sense.

When you say setting company standard; is that something that the user still has to apply the settings say when you download a new catalog part?

I think for neutral file formats this would work great since SW just grabs the default template you set so I assume it loads it with proper image quality settings. But if it's a Native SW files (some of our catalog files are Native; SMC cylinders or McMaster native SW file) that needs to be set after opening the files since the template is whatever the vendor saved the files with? Correct?
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

@gupta9665

Thank you.

Follow up question:
What would be your workflow then say if you have an assembly of 500 parts in PDM and you know there are some parts that have high image quality settings.

You would do a complete check-out on the root assembly then run the macro?
User avatar
AlexLachance
Posts: 2174
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2353
x 2008

Re: Setting Image Quality For All Parts in an Assembly

Unread post by AlexLachance »

Slasher wrote: Mon Apr 29, 2024 10:01 am When you stay setting company standard; is that something that the user still has to apply the settings say when you download a new catalog part?

I think for neutral file formats this would work great since SW just grabs the default template you set so I assume it loads it with proper image quality settings. But if it's a Native SW files (some of our catalog files are Native; SMC cylinders or McMaster native SW file) that needs to be set after opening the files since the template is whatever the vendor saved the files with? Correct?
I believe catalog parts from 3DContentCentral or McMaster or whichever place they come from will not use your template to generate themselves, so you will need to toggle these manually upon creation. So your assumption would be correct.
Slasher wrote: Mon Apr 29, 2024 10:04 am Follow up question:
What would be your workflow then say if you have an assembly of 500 parts in PDM and you know there are some parts that have high image quality settings.

You would do a complete check-out on the root assembly then run the macro?

You could do a complete check-out on the whole assembly and then use this setting to apply the setting everywhere: (Apply to all referenced part documents)
image.png
https://help.solidworks.com/2021/Englis ... isplay.htm
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

@AlexLachance

Thank you!

The only issue I have with "Apply to all referenced part documents" is this:

Let's say I open my root assembly. I then set image quality to 20% & check the "Apply to all referenced part documents" and it successfully applies that settings to all the parts; okay perfect. I also have all the parts checked-out. At this point I perform a save operation.

However if I close the root assembly & open a sub-assembly or a component belonging to the root assembly then it opens with the settings it was last saved as (meaning the 20% only takes effect on these parts when I open the root assembly).

So in order to have all the components at 20% permanently I need to apply that settings at root level; but then open everything and do a save operation.

So I guess now my question is: Is there a way to force save operation on all the part in an assembly without directly opening them? I heard of batch operations macro that go through a series of files one by one; maybe that's the only option?
User avatar
AlexLachance
Posts: 2174
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2353
x 2008

Re: Setting Image Quality For All Parts in an Assembly

Unread post by AlexLachance »

Slasher wrote: Mon Apr 29, 2024 11:03 am @AlexLachance

Thank you!

The only issue I have with "Apply to all referenced part documents" is this:

Let's say I open my root assembly. I then set image quality to 20% & check the "Apply to all referenced part documents" and it successfully applies that settings to all the parts; okay perfect. I also have all the parts checked-out. At this point I perform a save operation.

However if I close the root assembly & open a sub-assembly or a component belonging to the root assembly then it opens with the settings it was last saved as (meaning the 20% only takes effect on these parts when I open the root assembly).

So in order to have all the components at 20% permanently I need to apply that settings at root level; but then open everything and do a save operation.

So I guess now my question is: Is there a way to force save operation on all the part in an assembly without directly opening them? I heard of batch operations macro that go through a series of files one by one; maybe that's the only option?
I personally did all our parts/assemblies individually with #TASK when it was available. I thought that setting I showed you applied to all parts as it is a setting that is used in some macros to toggle quality everywhere but it seems I was mistaken, my apologies.
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

No worries! Technically you were correct that it applies to all parts. The limitation is that there's not an easy way to permanently (i.e. save) apply that settings to all referenced components.

Though describing it as a limitation may not be correct; since as @mp3-250 said if there was such an option it would probably cause havoc as it means asking Solidworks to perform save operation on thousands of parts and that will just cause crashing?!

I guess conclusion is I need to find a batch processor that can run this macro one-by-one or see if Task Scheduler has an option for this.
User avatar
SPerman
Posts: 2035
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2207
x 1860
Contact:

Re: Setting Image Quality For All Parts in an Assembly

Unread post by SPerman »

I also recommend #TASK, even though it is no longer free.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Setting Image Quality For All Parts in an Assembly

Unread post by mp3-250 »

I am developing a pdm task to update our hardware.
there is an example in the KB with a general task (i.e. different from the usual print and conversion) and you could modify it.

For my purpose I will lauch a task that:
・open a part file (ignore assy)
・cache locally the latest version
・checkout
・set the document properties (image quality etc)
・cycle through configurations and force rebuild them
・save
・checkin overwriting the latest version and deleting the locally cached version

in this way you can launch the task from the pdm explorer interface, using the search, the bom tab etc, selecting the files and launching the task from there.
I skip the assemblies as the correct rebuildng order is bottom up and I want the parts to be updated before their parents. So the process must be repeated for each sub assembly manually.
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

I wanted to add an update to this post:

I found a good solution in another topic; here's the link (essentially using a batch processor; in this case Batch+)
viewtopic.php?p=35105#p35105

Here was the workflow:

checked-out parts from root assembly
downloaded this macro https://www.codestack.net/solidworks-ap ... ty-coarse/
downloaded and installed batch+ (I am using community version which is limited functionality but has what I need)
added the downloaded macro to batch+
added my assembly file to batch+ and instructed the software to run it on all its reference files as well

video on specific steps can be found here (using a different macro):

Thanks all of the help.
Slasher
Posts: 43
Joined: Mon Oct 23, 2023 6:13 pm
Answers: 0
x 39
x 20

Re: Setting Image Quality For All Parts in an Assembly

Unread post by Slasher »

mp3-250 wrote: Mon Apr 29, 2024 9:19 pm I am developing a pdm task to update our hardware.
there is an example in the KB with a general task (i.e. different from the usual print and conversion) and you could modify it.

For my purpose I will lauch a task that:
・open a part file (ignore assy)
・cache locally the latest version
・checkout
・set the document properties (image quality etc)
・cycle through configurations and force rebuild them
・save
・checkin overwriting the latest version and deleting the locally cached version

in this way you can launch the task from the pdm explorer interface, using the search, the bom tab etc, selecting the files and launching the task from there.
I skip the assemblies as the correct rebuildng order is bottom up and I want the parts to be updated before their parents. So the process must be repeated for each sub assembly manually.
Can you please elaborate on:
cache locally the latest version & deleting the locally cached version? These won't happen at check out and check in automatically? How do you do these operations?
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Setting Image Quality For All Parts in an Assembly

Unread post by mp3-250 »

Slasher wrote: Wed May 01, 2024 9:21 pm Can you please elaborate on:
cache locally the latest version & deleting the locally cached version? These won't happen at check out and check in automatically? How do you do these operations?
It is an automated TASK, so we have to cover a lot of scenarios and avoid assumptions.

IF the workstation has not yet cached the file then it retrieves the latest version, but if the workstation already cached the file at some point, the latest version is not automatically retrieved and the past version is opened. (at least if you do not force the use of latest version in your vault)

Deletion from the local cache is not automatic otherwise tbe network traffic would be like a file server with all the data retrieved in real time and not on user demand: we had a user that after years got 30GB of data cached locally and those were old jobs that were not needed anymore.
Under explorer tools menu (iirc I am not in front of my pdm client, I am in vacation right now it could be the Edit menu)you can clean the selected folder local cache otherwise it stays there... forever. Probably the deletiom could be set to happen automatically, but it is not a standard PDM setup afaik.

for this reason since the TASK PC is going to update a big part of our vault I want to be sure that after the operation the local cache is restored to its clean state otherwise GBs of data will be cached there.
Post Reply