Message 1 of 3
DWFx not export correctly revit links mirror in the same project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to export a 3D view in which I have revit links mirrored in the 3D view, the problem is that when doing the dwfx export, not all the revit links that are mirrored are displayed, only one is displayed. I tried to do it with revit but it doesn't work, I have this code in c#, and it doesn't work as it should either.
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// Obtener la aplicación y el documento activo
UIApplication uiApp = commandData.Application;
UIDocument uiDoc = uiApp.ActiveUIDocument;
Document doc = uiDoc.Document;
// Definir la vista activa
View view = uiDoc.ActiveView;
// Definir la ruta del archivo DWFX
string filePath = "E:\\DWFx";
// Crear una nueva instancia de ViewSet
ViewSet views = new ViewSet();
// Agregar la vista activa al conjunto de vistas
views.Insert(view);
// Crear opciones para la exportación a DWFX
DWFXExportOptions dwfxOptions = new DWFXExportOptions();
// Configurar las opciones según sea necesario
dwfxOptions.MergedViews = true;
dwfxOptions.ExportingAreas = true;
try
{
// Iniciar una transacción
using (Transaction transaction = new Transaction(doc, "Exportar a DWFX"))
{
transaction.Start();
// Exportar la vista a DWFX dentro de la transacción
doc.Export(filePath, "Vista-Test", views, dwfxOptions);
// Confirmar la transacción
transaction.Commit();
}
// La exportación fue exitosa
TaskDialog.Show("Exportación exitosa", "La vista se ha exportado a DWFX correctamente.");
return Result.Succeeded;
}
catch (Exception ex)
{
// La exportación falló
message = ex.Message;
return Result.Failed;
}
}