Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning to sheet.print_to_file [BUG] #58

Closed
Tian-Jionglu opened this issue Oct 10, 2020 · 3 comments
Closed

Add a warning to sheet.print_to_file [BUG] #58

Tian-Jionglu opened this issue Oct 10, 2020 · 3 comments
Assignees

Comments

@Tian-Jionglu
Copy link
Contributor

Describe the bug
It seems that sheet.print_to_file method only works with absolute directory argument.

To Reproduce

from pycatia import catia

caa = catia()
drawing_doc = caa.active_document
sheets = drawing_rt.sheets
sheet = sheets[0]

sheet.print_to_file("./test.prn") # expected print to current directory
sheet.print_to_file("F:/temp/test.prn") # 'F:/temp/' exist.
sheet.print_to_file("F:/output/test.prn") # 'F:/output/' didn't exist. expected an error

Expected behavior
As a result, only second print_to_file (to 'F:/temp/') works as expected.
If this method performances the same in other environment, it's better to raise a warning, like "currently, this method only works with absolute directory argument. And this directory must already exist."

Desktop (please complete the following information):

  • OS: Windows 10
  • CATIA V5 R19
  • pycatia 0.4.3
@evereux
Copy link
Owner

evereux commented Oct 10, 2020

Added a commit to development branch. Take a look and let me know if that's what you're expecting.

Cheers.

@Tian-Jionglu
Copy link
Contributor Author

Thank you for your quick reply.
We are almost there.
There is still problem with clause sheet.print_to_file("../test.prn"), which expected a file printed to the parent directory.
return self.drawing_sheet.PrintToFile(file_name.absolute()) seems can solve this problem. See the pull request.
When every scenario works as expected, I think no more warning is needed. 😄

@Tian-Jionglu
Copy link
Contributor Author

Further discussion see issue #61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants