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

ReferenceIFC added Out reference to get the ElementId #423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emilianocapasso
Copy link

while I was building an automation to link IFCs into a file, I found it useful to add an out reference to the method in order to catch the ElementId of the newly imported document and manipulate it afterward

@@ -439,8 +439,10 @@ private bool DocumentUpToDate(Document doc, string ifcFileName)
/// <param name="document">The host document for the import.</param>
/// <param name="origFullFileName">The full file name of the document.</param>
/// <param name="options">The list of configurable options for this import.</param>
public void ReferenceIFC(Document document, string origFullFileName, IDictionary<String, String> options)
public void ReferenceIFC(Document document, string origFullFileName, IDictionary<String, String> options, out ElementId revitLinkTypeId)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to just return the ElementId instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was my first idea, but I've thought that changing the return method from void to ElementId could it be potentially more distruptive for existing codes which uses this DLL rather than leaving to void and using an out reference

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I guess it depends if it is overridden or not. I would think changing void to ElementId as a return wouldn't be so bad, would it? Vs. changing the signature?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, returning ElementId it would be cleaner and more straightforward too, if you think that's ok for compatibility I'd also prefer that way,

do you want me to create another pull request with the implementation?

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

Successfully merging this pull request may close these issues.

2 participants