rmcanany / SolidEdgeHousekeeper

Utility for finding annoying little errors in your Solid Edge project
MIT License
23 stars 10 forks source link

Add file extension document type check to part and sheet metal #77

Closed ChrisClems closed 6 months ago

ChrisClems commented 6 months ago

I based this on the latest release as there appears to be some major unfinished structural changes going on right now. Please edit accordingly or advise how I can update it to the new project layout.

This PR adds check options to the part and sheet metal tabs to check the file extension against the SE document type. This was added because historically some people have advised on the official SE message board that .PAR and .PSM file formats are identical, and that you can change the file extensions with impunity. This is not the case, as the underlying document type remains the same as the originally created file type even through environment changes and file saves. I now have a library of parts which were created as .PAR files but at some point renamed to .PSM and treated as sheet metal parts. This becomes an issue when you try to cast the document to a sheet metal part via the API. It will fail.

You can demonstrate this issue by creating a new .PAR file, renaming it to .PSM, then running it through any of the sheet metal checks in Housekeeper which cast to a SheetMetalDocument type. It will fail with a cast exception.

Perhaps since this impacts other checks in the sheet metal and part tabs, it should be implemented in a way in which the check is done before any other checks.

rmcanany commented 6 months ago

Hey Chris,

First off, thank you for the contribution. I really appreciate the help!

As you noticed, I'm rearranging things. In particular fixing the mess that is the current way Tasks are handled. They're now all in separate classes, with each able to accept any (applicable) file type. As a part of that effort, I stumbled across the fix you provided. I didn't think to return an error, though. That's a great idea and I'm going to include it.

I'll credit you with the contribution. If you don't mind I'll also include you as a contributor in the Readme. That's not worth any money, but, you know, it ups your 'cred' around here!

Thank you again for your effort. All improvements are welcome, so please jump in anytime!

Robert

ChrisClems commented 6 months ago

Hey Chris,

First off, thank you for the contribution. I really appreciate the help!

As you noticed, I'm rearranging things. In particular fixing the mess that is the current way Tasks are handled. They're now all in separate classes, with each able to accept any (applicable) file type. As a part of that effort, I stumbled across the fix you provided. I didn't think to return an error, though. That's a great idea and I'm going to include it.

I'll credit you with the contribution. If you don't mind I'll also include you as a contributor in the Readme. That's not worth any money, but, you know, it ups your 'cred' around here!

Thank you again for your effort. All improvements are welcome, so please jump in anytime!

Robert

Thanks for the credit! I have a few more random SE troubleshooting scripts sitting around. Once the next release is out, I will see about incorporating them in the new structure.

rmcanany commented 6 months ago

Sounds great. Looking forward to working with you!

On Mon, Mar 18, 2024 at 4:15 PM Chris C. @.***> wrote:

Hey Chris,

First off, thank you for the contribution. I really appreciate the help!

As you noticed, I'm rearranging things. In particular fixing the mess that is the current way Tasks are handled. They're now all in separate classes, with each able to accept any (applicable) file type. As a part of that effort, I stumbled across the fix you provided. I didn't think to return an error, though. That's a great idea and I'm going to include it.

I'll credit you with the contribution. If you don't mind I'll also include you as a contributor in the Readme. That's not worth any money, but, you know, it ups your 'cred' around here!

Thank you again for your effort. All improvements are welcome, so please jump in anytime!

Robert

Thanks for the credit! I have a few more random SE troubleshooting scripts sitting around. Once the next release is out, I will see about incorporating them in the new structure.

— Reply to this email directly, view it on GitHub https://github.com/rmcanany/SolidEdgeHousekeeper/pull/77#issuecomment-2005002821, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKPB4B57ZJA6N5IIRYQMATYY5KNLAVCNFSM6AAAAABE4B5SNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBVGAYDEOBSGE . You are receiving this because you commented.Message ID: @.***>

farfilli commented 6 months ago

I think a check of file compatibility with the current Solid Edge installed version should be performed. I have for some reason some student files on my drive and if I try to process by HK and a commercial license I get unexpected behaviour. Not sure if add to this issue or create a new one.

rmcanany commented 6 months ago

Let's make a new issue. Since I already implemented the file type check, Chris withdrew his commit.

I can't do it right now, but can add it later if you don't get to it.

On Wed, Mar 20, 2024 at 9:42 AM Francesco @.***> wrote:

I think a check of file compatibility with the current Solid Edge installed version should be performed. I have for some reason some student files on my drive and if I try to process by HK and a commercial license I get unexpected behaviour. Not sure if add to this issue or create a new one.

— Reply to this email directly, view it on GitHub https://github.com/rmcanany/SolidEdgeHousekeeper/pull/77#issuecomment-2009739474, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKPB4FUFDQYSCRGUY24D3LYZGN6NAVCNFSM6AAAAABE4B5SNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBZG4ZTSNBXGQ . You are receiving this because you commented.Message ID: @.***>