How Do I Conditionally Block Executing PostableCommand.LinkSomething?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
In the plugin (C#, .NET) I would like to monitor the fact that the user attempts to insert a Revit Link, PDF Link, or a CAD Link and this is quite easily doable by CreateAddInCommandBinding and BeforeExecuted.
However, I would also like to block this option, as if I had assigned an empty function to the AddInCommandBinding.Executed, but I would like to do it conditionally, if and only if the file attempted to be linked is bigger than the pre-defined filesize or its name contains any non-ASCII characters.
My questions are in fact two:
1. Where do I check the system information about the file which is attempted to be linked (I mean: where is this data stored? So far I've been looking through the members and nested members of Element in a loop through all Elements added or modified in DocumentChangedEvent raised right after linking the file but no success)?
2. How and where do I setup a condition that, after the check, blocks the further execution of PostableCommand or not?