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

Create.FamilyInstance - activate fix #1366

Merged

Conversation

michal-pekacki
Copy link
Contributor

@michal-pekacki michal-pekacki commented Jun 12, 2023

NOTE: Depends on

Issues addressed by this PR

Closes #1365

Added family symbol activate to avoid crashing if not activated.

Test files

Changelog

Additional comments

@michal-pekacki michal-pekacki added the type:bug Error or unexpected behaviour label Jun 12, 2023
@michal-pekacki michal-pekacki added this to the BHoM 6.2 β MVP milestone Jun 12, 2023
@michal-pekacki michal-pekacki self-assigned this Jun 12, 2023
Copy link
Member

@pawelbaran pawelbaran left a comment

Choose a reason for hiding this comment

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

Happy with the code changes @michal-pekacki, but could you pls add the same tweak to adaptive component create method? Thanks!

Copy link
Member

@pawelbaran pawelbaran left a comment

Choose a reason for hiding this comment

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

Happy to approve the changes following the review and quick testing.

@pawelbaran
Copy link
Member

@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@pawelbaran to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

@pawelbaran
Copy link
Member

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@pawelbaran to confirm, the following actions are now queued:

  • check installer

There are 11 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

FraserGreenroyd commented Jun 12, 2023

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 2 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 7 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 19 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 22 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 27 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. Renew the cache

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd I have updated the cache as requested.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. Renew the cache

2 similar comments
@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. Renew the cache

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. Renew the cache

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 1 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 1 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 2 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 3 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 4 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 5 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

There are 1 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check installer

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check copyright-compliance
@BHoMBot check dataset-compliance
@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 12, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check copyright-compliance
  • check dataset-compliance
  • check ready-to-merge

@FraserGreenroyd FraserGreenroyd merged commit 5d19979 into develop Jun 12, 2023
@FraserGreenroyd FraserGreenroyd deleted the Revit_Toolkit-#1365-FamilyInstanceActivateFix branch June 12, 2023 19:50
@bhombot-ci bhombot-ci bot mentioned this pull request Jun 12, 2023
@travispotterBH
Copy link

@pawelbaran Was taking a look at this as part of other work and noticed that it seems that a document.Regenerate() is required after an familyInstance.Activate() to see the benefits of its use. A document.Regenerate() can only be used within a transaction. So does it make sense to cover this call here as it seems that it might give the false impression that the geometry has ben filled?
image
I may be misunderstanding the documentation at revitapidocs.com though.. https://www.revitapidocs.com/2023/b4e09402-f6cd-3f48-d01e-ecb87375bac5.htm

https://www.revitapidocs.com/2023/22468e2c-9772-8478-0816-c9759aa43428.htm
image

@pawelbaran
Copy link
Member

I must say that I have learnt about activation status of FamilySymbol empirically so I may be wrong, but from what I reckon, the only situation it is inactive is when the family type gets loaded, but not used yet.

Regardless, this should not matter in the context of this PR: we simply make sure the symbol is active when calling Create.FamilyInstance. Also not sure if I see the problem with activation requiring transaction - creation of a Revit element needs it so we should assume that Create.FamilyInstance will always be wrapped in one.

@travispotterBH
Copy link

creation of a Revit element needs it so we should assume that Create.FamilyInstance will always be wrapped in one.

Maybe we need to add .Regenerate() into this method.

@pawelbaran
Copy link
Member

Maybe we need to add .Regenerate() into this method.

Did you check if we need? The method works as intended from what I know.

@michal-pekacki
Copy link
Contributor Author

.Regenerate() can freeze model for a very long time, especially models with many linked files - I would only use it if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FamilyInstance crashes - family symbol is not active
4 participants