Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fix Revit API GAP for Preview Visibility

Fix Revit API GAP for Preview Visibility

I'd like to be able to turn on Preview Visibility through the Revit API so that when I bulk upgrade all of my company's Revit Families I can build into my Revit Add-in command that the preview visibility shall be turned on before saving and closing the family. This is super important for the correct creation of preview images for all families.

1 Comment
dfoth
Advocate

Nevermind. Thanks Christoph_Marthaler_AWZH

var uiApp = commandData.Application;
var uiDoc = uiApp.ActiveUIDocument;
var doc = uiDoc.Document;
var activeView = uiDoc.ActiveGraphicalView;

using(var tx = new Transaction(doc))
{
    tx.Start("Set View Mode");
    activeView.TemporaryViewModes.PreviewFamilyVisibility = PreviewFamilyVisibilityMode.On;
    tx.Commit();
}


https://forums.autodesk.com/t5/revit-api-forum/set-preview-visibility-in-family-editor-using-revit-a...

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea