Create a new legend view

Hi there,
my attempt goes through the postable command route as no API exists for direct creation of legend

    with revit.Transaction('Create new legend view'):

        newview = HOST_APP.post_command('ID_VIEW_NEW_LEGEND')

but I still need to validate the legend creation window
I was guessing something like this might work. but it does not

        HOST_APP.post_command('IDOK')

I have looked quite extensivley in the pyrevit library and could not find anything to validate a revit dialog button.
Do you have any ideas if it is possible to make it work this way or some other?

Thanks

1 Like

I have no experience with this but I think @eirannejad explained in some video that you can’t create Legend View using Revit API. Therefore you need to have one in the project and then you can duplicate it.

here is an example he achieved that:

2 Likes