SimplifiedLogic / creoson

OpenSource Automation using JSON Transactions for PTC's CREO Parametric
http://www.creoson.com
MIT License
81 stars 23 forks source link

Windchill clear_workspace raising error but do the job ¯\_(ツ)_/¯ #37

Closed Zepmanbc closed 4 years ago

Zepmanbc commented 4 years ago

Hi! I'm using the windchill command with clear_workspace function to delete 1 file. Here is the request:

{
    'sessionId':'5170641809148701105',
    'command':'windchill',
    'function':'clear_workspace',
    'data':{
        'workspace': 'test_workspace',
        'filenames': ['toto_02.prt']
    }
}

the file 'toto_02.prt' is well deleted but it returns me a message error:

{status: {
    'error':True,
    'message':'A Pro/TOOLKIT error has occurred: Found.  Check your model/drawing for accuracy.'
    }
}

it works fine but I don't understand why there is an error returned.

PS: Do you think it is possible to use wildcard selection for choosing files instead of a list? ( like "toto_*.prt")

adama2000 commented 4 years ago

I'm guessing that Creo is returning a "Found" error to indicate that it found the file -- which is not really an error. I need to modify the creoson function to ignore any "Found" errors it gets.

Zepmanbc commented 4 years ago

that would be great, thanks!

adama2000 commented 4 years ago

I'll think about the wildcard option. That would require looping through all the files in the workspace to find out which ones match, and that would take a while on a large workspace.

adama2000 commented 4 years ago

I've checked in code to ignore the "Found" error on clear_workspace, so the change will be in the next release.

Zepmanbc commented 4 years ago

great thank you :pray: