|
|
Set of properties used when publishing a file
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
| Visual Basic |
|---|
Public Class PublishProperties _ Inherits NativeHandle |
| C# |
|---|
public class PublishProperties : NativeHandle |
| Visual C++ |
|---|
public ref class PublishProperties : public NativeHandle |
Remarks
This class identifies the Navisworks properties involved in publishing a file.
The current PublishProperties applicable to the Model can be accessed by Model.PublishProperties.
To publish a Navisworks file with a set of PublishProperties use either of the following:
Examples
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() { //Create the PublishProperties object PublishProperties properties = new PublishProperties(); //Set the published file's properties 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"); //create the published NWD try { Autodesk.Navisworks.Api.Application.ActiveDocument.PublishFile(@"C:\publishedFile.nwd", properties); } catch (Autodesk.Navisworks.Api.DocumentFileException) { //Failed to publish ile, perhaps try saving in //an alternate location using the exception safe method 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"); } }
Inheritance Hierarchy
System..::..Object
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..PublishProperties
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..PublishProperties