Automation (mass) of the bounding box (overall dimension)

Hi all

 

I try to recover the dimensions from a set of parts in order to be able to extract them.

Is there a way to automate the handling to avoid opening each part and/or assembly to launch the "bounding box" utility?

 

Thank you in advance for your help

Florian 

Hello

Yes, it is possible to make a small program that would allow you to:

- Load from a list a share or an ASM in SW.

- Calculate the overall dimensions according to X, Y and Z.

- Retrieve these values and the name of the loaded file to write them to a log file.

- Close the PRT or ASM.

- Move to the next file.

However, it requires some knowledge of VB.net or C# programming and also a little time.

Are your files in windows or in Epdm because it changes the game a bit for the program?

Is there a large amount of files to be scanned?

Kind regards

1 Like

Here is a small program that already allows you to give the overall dimensions of an ASM or PRT file loaded in SW.

To unzip on the desktop, then start SW, load a 3D file, launch the program and click on the only button there is.

This program includes the function of calculating overall dimensions but that's all for now, I could provide the sources if this is suitable.

Kind regards


boundingbox.zip

Hi d.roger,

Thank you for your feedback.

To clarify my need:

- I have about a little less than 1000 pieces to process.

- They are located on windows.

- Ideally, you should run a utility that writes the X, Y and Z values in the PART or ASM settings

This would then allow me to generate a part list with this information but others as well

 

Once again thank you for your help

Florian

 

Hello

Here is another version of the program that allows you to:

- Loading a CSV file containing the list of files to be analyzed, please note that this list must be formatted like the file liste.csv attached with the program.

- Open each file in Solidworks.

- Calculate the outer dimensions of each 3D loaded.

- Save the result in a csv file named résultat.csv and stored in the same directory as the attached executable.

It's best to test a small amount of 3D file copy to get started.

I didn't create the function to save the result in the 3D file settings because as an external person I don't think I have to intervene on them in edit mode.

If you have programming knowledge, I could provide you with the source code of the attached program to adapt to your needs.

Kind regards


boundingbox.zip
1 Like

Frankly it works really well, a big thank you.

Personally I don't have a lot of reference in programming, but I want to get the source for information.

It's a real shame that SW doesn't allow you to retrieve this information automatically.

Againthank you for your help

Florian

 

 

Attached is a text file containing the functions used in the program attached in the previous post (it's in C#).

If the program works for you, solved the subject?

Kind regards


fonctions.txt
1 Like

 @ D.Roger

Yes, a big thank you to you once again

 

Hi all

Following an improvement request and a few exchanges with froussel, I am making available a new version of the "boundingbox" utility. This new version makes it possible to record the dimensions of the dimensions as well as the mass for each configuration of the Solidworks files.

Kind regards


boundingbox-3.zip
2 Likes

Thanks to D. Roger for his availability.

The new version should make life easier for those who have to size packaging boxes / cartons / case for their parts / assemblies

Attention for EPDM users : the files must exist locally on the computer that launches the program and the version of the local files must be the correct one. if the local file does not exist, the program returns an error message but if the version is "bad" it does the calculation with the version of the local view (but it also allows you to make a comparison between 2 versions if you run the program 2 x on 2 different versions)

1 Like

Hello, (Happy New Year!)

I'm sorry to dig up a topic that is 3 years old but I'm having a problem..

I've tried to run your programs one by one but nothing works. In the result file I get opposite each box: non-existent files

I checked the path well, try in a folder on the desktop, with different names (I had a comma in each part name so Excel didn't understand and put question marks instead..), using your "list" file to create my part list, ..

I also thought, I'm on SW20 SP04, does your program work on the new versions?

Thank you so much if you reply again after all this time.  

Kind regards

 

With a little luck @d.roger will go through this and will know how to answer you better than anyone since he is the author.

1 Like

Hello

The "Files non-existent" error indicates that the files listed in the liste.csv file are not found or do not exist, how is your liste.csv file written? Can you post it?

Kind regards

Hello

I attach the list file that I use (I took your file provided in the ZIP and I changed the lines)

Thank you so much for your time! 

Kind regards


liste.csv

Hello

Here's what I come across as a file name when I open the list file in a text editor:

We should try with simpler filenames to see if it comes from the SW version (which I doubt) or the filename (a bit complicated). For the essay, it is preferable to avoid names with accents or particular signs.

Kind regards

1 Like

Thank you for your answer!

So yes I thought about it but the problem comes from the fact that: it's the customer who names his parts this way and in a typical assembly there are 700 of them, so too complicated to rename everything unfortunately...

(I did a test out of conscience, with classic "MMPPLATFORM562T1" names, it doesn't work either...)

Kind regards

 

Hello

The error found is in the reading of the file path so before the intervention in Solidworks, which surprises me a little ... Is it possible to take screenshots of the program as I use it and send me the résultat.csv file that results from the test?

I can't test on a 2020 version since I'm on 2019.

Kind regards

Then

You ask me for the steps of the program but none of them are performed: I click on the button, the result file appears on the desktop 

I'm still attaching the files and a screenshot 

(I don't understand how to attach several files in a message? is it possible or do I have to make a ZIP?)

Thank you

Kind regards 


liste.zip

Is it possible to try putting the file extensions in the liste.csv file such as "C:\Users\AA\Desktop\TRIALS\MMPPLATFORM562T1.sldprt" otherwise the file is effectively non-existent (even if the extensions are not displayed in Windows, they still exist).

Kind regards

Hello 

I tried it and it works! 

So, I did a test by putting .sldprt, it gives me the lengths well but I have more lines telling me "non-existent file", I guess it's for another function of the program?

So I tried with the original names containing commas and unfortunately it doesn't work.. When opening the result document, the comma of each line appears like this: "ï¿1/2" 

Thank you for your help! If you have an idea I'm always interested. (mass renaming or other ..)

Kind regards


resultat.csv