Properties specified when model was last published. Will be null if model has not been published.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Examples
CopyPublishing a Navisworks file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using Autodesk.Navisworks.Api.Controls;
static public void PublishFile()
{
PublishProperties properties = new PublishProperties();
properties.AllowResave = true;
properties.Author = "Mr A.N. Other";
properties.Comments = "this is the comment for the file";
properties.Copyright = "Autodesk Ltd. 2010";
properties.DisplayAtPassword = true;
properties.DisplayOnOpen = true;
properties.EmbedDatabaseProperties = true;
properties.EmbedTextures = true;
properties.ExpiryDate = new DateTime(2099, 12, 31);
properties.Keywords = string.Empty;
properties.PreventObjectPropertyExport = false;
properties.PublishDate = DateTime.Now;
properties.PublishedFor = "Mrs. Other";
properties.Publisher = "A. Person";
properties.Subject = "The subject field";
properties.Title = "Title of the content";
properties.SetPassword("Password");
try
{
Autodesk.Navisworks.Api.Application.ActiveDocument.PublishFile(@"C:\publishedFile.nwd", properties);
}
catch (Autodesk.Navisworks.Api.DocumentFileException)
{
if (!Autodesk.Navisworks.Api.Application.ActiveDocument.TryPublishFile(@"C:\publishedFile2.nwd", properties))
{
MessageBox.Show("Failed to publish the file");
}
}
catch (System.InvalidOperationException)
{
MessageBox.Show("Document is clear");
}
}
Exceptions
See Also