Closed CADBIMDeveloper closed 1 year ago
@CADBIMDeveloper
реализуй IDescriptorCollector вместо IDescriptorResolver https://github.com/jeremytammik/RevitLookup/blob/dev/Contributing.md#idescriptorcollector
Это работает потому что IDescriptorResolver уже реализует IDescriptorCollector и позволяет снупить объект https://github.com/jeremytammik/RevitLookup/blob/dev/Contributing.md#idescriptorcollector
Ну а удаление строчки из DescriptorMap позволяет снупить потому что этот класс FamilyParameter наследуется от ApiObject, который уже и так зарегистрирован, лукап использует более базовый класс, вот и вся магия
Можно обойтись и без этой перегрузки, а просто добавить обычный if перед регистрацией расширения
if(_parameter.Element.Document.IsFamilyDocument)
{
manager.Register(...);
}
Ок, завтра)
P.S. IDescriptorCollector проморгал как-то
Да давай) без проблем
@Nice3point , привет.
я чуток по другому сделал вместо:
if(_parameter.Element.Document.IsFamilyDocument)
IExtensionManager теперь имеет публичное свойство документа.
Мотивация: не у всего в API можно достучаться до документа, т.е. либо передавать в Descriptor ещё и документ (что ИМХО, не очень) либо не иметь возможности делать больше Extension-ов.
Пример - тот самый FamilyParameter. Там есть простор для того, чтобы расширять его Extension-ами с доступом через FamilyManager
Привет, да я тоже думал там документ свойством потом сделать именно для этого. Спасибо что сделал это сам. Я гляну Pr чуть позже как за комп сяду)
@jeremytammik hey Jeremy, what about checking the PR and getting everything agreed? (
hi roman, i did not translate the russian, and assumed that my agreement was required purely pro forma. the RevitLookup coding has reached a point now that exceeds my competence. i trust and hope that i can leave it in your capable hands to check. is that OK?
Sorry, Jeremy :-) @Nice3point , we should use English here
@jeremytammik Yes, Jeremy no problem, we will discuss it in English, it was just quicker to solve the problem in the native language. I can merge the PRs myself, it's fine)
Thank you! That is a relief!
Summary of the Pull Request
What is this about: Added an ability to show associated family parameters Description:![lookup](https://github.com/jeremytammik/RevitLookup/assets/14212214/799047cf-0de3-4a5e-a9b8-31e823d0c31a)
Quality Checklist
Issues (the PR is a draft now)
otherwise it shows a non-snoopable text like:![non-snoopable](https://github.com/jeremytammik/RevitLookup/assets/14212214/a9577924-0ed6-48f7-9bf4-b7905d7bfd40)
if I remove FamilyParameterDescriptor registration (what I obviously don't want to do :-)) https://github.com/jeremytammik/RevitLookup/blob/f52d2fef57c27159d0029866daba12bf482c5351/RevitLookup/Core/ComponentModel/DescriptorMap.cs#L68, it also becomes snoopable:![snoopable-if-remove-the descriptor](https://github.com/jeremytammik/RevitLookup/assets/14212214/c8c66615-0dd2-4f63-ab01-d4fb78683fa7)
@Nice3point , you know the codebase much deeper than me, probably, it's better if you'll fix it :-)
So we'll avoid adding GetAssociateFamilyParameters extension in non-family editor contexts