Message 1 of 8
Spell Check all Sheets

Not applicable
04-19-2015
03:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to create a macro that will spell check all sheets in a project. I have what I think should work, but I get an error that says something like "revit does not support more than one posted command". I think the problem might be that the post command has not finished when it's already trying to change the activeview to the next sheet. Any ideas? I thought this was going to be an easy macro for me to start with.
public void theMacro() { Document doc = this.ActiveUIDocument.Document; UIApplication application = this; FilteredElementCollector collector = new FilteredElementCollector(doc); ICollection<Element> collection = collector.OfClass(typeof(ViewSheet)).ToElements(); RevitCommandId id = RevitCommandId.LookupCommandId("ID_CHECK_SPELLING"); foreach (Element element in collection) { if (!element.HasPhases()) { //this is how I'm getting sheets - probably a better way application.ActiveUIDocument.ActiveView.Equals(element); application.CreateAddInCommandBinding( id ); application.PostCommand(id); } }
}