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

write_entries result in an empty file #2

Closed
CyrilWaechter opened this issue Jun 15, 2019 · 3 comments
Closed

write_entries result in an empty file #2

CyrilWaechter opened this issue Jun 15, 2019 · 3 comments

Comments

@CyrilWaechter
Copy link
Contributor

Hi,

I tried to use rsparam to write entries but the result file is empty of any entry.

Test code used : 

import rsparam
src_file = "shared_parameters.txt"
encoding = "utf_16_le"
entries = rsparam.read_entries(src_file, encoding)
rsparam.write_entries(entries, src_file, encoding)

Result txt file :

# This is a Revit shared parameter file.
# Do not edit manually unless you know better!
*META	VERSION	MINVERSION
META	2	1
*GROUP	ID	NAME
*PARAM	GUID	NAME	DATATYPE	DATACATEGORY	GROUP	VISIBLE	DESCRIPTION	USERMODIFIABLE

Note : when I read entries it works without any issue. I get many entries with all suitable parameters.

Did I misunderstood how write_entries works ? I peeked into the code but I do not understand yet what is going wrong.

@CyrilWaechter
Copy link
Contributor Author

I ran it with pycharm debugger and saw what was happening :

  • read_entries return a SharedParamEntries which hold a list of SharedParamGroup and a list of SharedParam.
  • write_entries read a list of SharedParamGroup and/or SharedParam but not a SharedParamEntries
    It seemed more logical to me as they are both named entries that write_entries would accept SharedParamEntries. I'll send you a proposal by pull request.

@eirannejad
Copy link
Contributor

@CyrilWaechter Hey seems like PR #3 solved this issue right? Would you mind testing and closing this if it works?

@CyrilWaechter
Copy link
Contributor Author

Yes, it solves this issue. That's why I referenced it in my PR.
Thanks for merging and pypi update.

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