pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Export to Navisworks

Open dosymep opened this issue 3 years ago • 5 comments

When I use standard export to Navisworks in my C# code opens output window with telemetry. How to close the output window?

image

dosymep avatar Apr 04 '22 09:04 dosymep

Are you printing to console?

eirannejad avatar Sep 04 '22 22:09 eirannejad

@eirannejad, This bundle is ".invokebutton". I can't print to console in my C# plugin.

dosymep avatar Sep 05 '22 07:09 dosymep

Ok so where are the logs coming from? There is no python involved since it is an .invokebutton right?

eirannejad avatar Sep 05 '22 17:09 eirannejad

@eirannejad, yep is not python code. I also can't understand where are these logs from?

dosymep avatar Sep 08 '22 09:09 dosymep

Sample Revit file with 3D view image

Minimum code to reproduce


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace PluginTest
{
    [Transaction(TransactionMode.Manual)]
    public class ExportCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var document = commandData.Application.ActiveUIDocument.Document;
            var view = document.ActiveView;
            var options = new NavisworksExportOptions();
            options.ViewId = view.Id;
            options.ExportScope = NavisworksExportScope.View;
            options.ExportElementIds = true;
            options.ConvertElementProperties = true;
            options.Parameters = NavisworksParameters.All;
            options.Coordinates = NavisworksCoordinates.Shared;
            options.FacetingFactor = 5.0;
            options.ExportUrls = false;
            options.ConvertLights = false;
            options.ExportRoomAsAttribute = false;
            options.ConvertLinkedCADFormats = false;
            options.ExportLinks = false;
            options.ExportParts = false;
            options.FindMissingMaterials = false;
            options.DivideFileIntoLevels = true;
            options.ExportRoomGeometry = false;

            document.Export(@"D:\Temp\Results", "Navisworks.nwc", options);
            return Result.Succeeded;
        }
    }
}

dosymep avatar Sep 09 '22 08:09 dosymep