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

ScheduleDefinition.GetField method not showing #70

Closed
RevitArkitek opened this issue Feb 8, 2021 · 4 comments
Closed

ScheduleDefinition.GetField method not showing #70

RevitArkitek opened this issue Feb 8, 2021 · 4 comments

Comments

@RevitArkitek
Copy link
Contributor

The method ScheduleDefinition.GetField does not show because it requires an integer index parameter. A list of ScheduleFields can be returned, named by the index that was used.

I have this working and can submit a pull request. I have an issue though, in that there are two GetField methods, the other taking in an id. I have not found a way to filter out the second method, so when viewing the ScheduleDefinition properties there will be two GetField entries. If you know of a way to filter out that second method you can let me know or you could add it. Otherwise it could be left as is or put on hold.

@jeremytammik
Copy link
Owner

That sounds great, very useful!

Thank you very much for the offer!

That would require analysing the complete GetField method signature.

The two overloads GetField(Int32) and GetField(ScheduleFieldId) have different method signatures:

https://www.c-sharpcorner.com/UploadFile/puranindia/method-signatures-in-C-Sharp/

They can be distinguished using by checking their parameter types using Reflection, as explained in how to get only methods with a specific signature out of Type.GetMethods:

https://stackoverflow.com/questions/5152346/get-only-methods-with-specific-signature-out-of-type-getmethods

@RevitArkitek
Copy link
Contributor Author

Sent pull request.

jeremytammik pushed a commit that referenced this issue Feb 9, 2021
#70 - Adds handler for ScheduleDefinition.GetField
Co-authored-by: michaelcoffey <[email protected]>
Co-authored-by: Jeremy Tammik <[email protected]>
@jeremytammik
Copy link
Owner

Thank you, merging now.

jeremytammik added a commit that referenced this issue Feb 9, 2021
…uleDefinition.GetField to address issue #70
@jeremytammik
Copy link
Owner

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