Reply

Getting a report of mass (weight) for all files in a directory

Good morning.  I am not a developer or coder, but I was wondering if someone has or could write some code to do the following:

 

Our company would like to massively obtain the Solid Edge weights from all of our psm, par, & asm files and I was wondering if someone has run across a report or would be willing to write some code that could go in and get the PN (document #) and the weight, and save it as an Excel or even txt file.

 

I know I can produce a report from the assembly environment and I can have the mass show up in the report, but I need to grab this information from every 3D file.

3 REPLIES

Re: Getting a report of mass (weight) for all files in a directory

Mike,

 

To my knowledge, this would require opening every single file (automated) in Solid Edge. Depending on how many files you have, that can be a lengthy process. Knowing that, is it something you still want? I'm always looking for real world needs like this to develop open source samples on GitHub for the community. I'd be willing to write it so that everyone can learn from it.

 

Also, I'm fairly ignorant to engineering so bare with me. You say that you want the weight but you also mention mass. From my reading, the two are not exactly the same thing. I know we can get mass via the API but I find no reference to weight. To confirm terminology, you want the mass?

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Getting a report of mass (weight) for all files in a directory

We would be looking at about 20,000 files that would have to be opened.  I would be looking for the mass in lbs.

 

The problem I could see while running the macro would be that what will happen if it runs into a file that does not have a density applied?  For example, if the density is 0.00 lb/cu in, you get a prompt when hitting the "Update" button that says: Densiity must be a positive numeric value.  Could it produce a list of the instaces of this but still continue to run automatically?  The number from the report would then have to be opened manually to set the correct density.

Re: Getting a report of mass (weight) for all files in a directory

Just an update for you. I am working on a sample for the community to do what you're asking. Once I'm done, I'll provide a download link to the compiled executable.

Jason Newell
Applications Architect
www.jasonnewell.net