Skip to content
Get on GitHub Autodesk App Store - coming soon

Navisworks: Model

5 nodes. Types ending in [] are lists. An input with a default is optional.

Model.Info

The cached and original source file paths of a model, its native units (unit-mismatch audits across appended files) and its root model item — one node for the federated-file inventory.

Inputs

Input Type Default What it does
model required Model — The model.

Outputs

Output Type
fileName file
sourceFileName file
units string
rootItem ModelItem

Returns: The cached and original file paths, the native units and the root item.

Tags: model info filename source path file units native root item tree

Model.Remove

Removes a WHOLE appended source model from the document (accepts a Model, a 0-based index, or a file name). Wire a LIST of models, indices or file names to remove several in one go: they are all looked up in the document as it is now and removed from the last to the first, so the indices [0, 1] remove the first two models, not the first and third. No API deletes individual elements — hide them and publish an NWD instead. Returns false when Navisworks refuses a removal. Cached model items from earlier runs are invalidated.

Inputs

Input Type Default What it does
model required any — The model to remove: a Model (from Document.Models), its 0-based index, or its file name. A list removes all of them in one go.
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
removed boolean True when every wanted model was removed; false when Navisworks refused one (e.g. the last remaining model).

Tags: model remove delete file appended detach unload

Model.Snapshot

Captures the named properties of the given items as a dictionary keyed by each item's instance GUID (items without one are keyed "path:" plus their tree path) — the input Snapshot.Diff compares, so save one with JSON.WriteToFile now and diff it against a later run to see added, removed and changed items. Nothing in the model is changed.

Inputs

Input Type Default What it does
items any number of wires required ModelItem[] — The model items to capture.
properties any number of wires required any[] — The properties to capture, written like Properties.ToTable: "Category.Property", "Category|Property", a bare name, or @Name, @Path, @Guid.

Outputs

Output Type What it gives
snapshot dict A dictionary from each item's instance GUID text to a dictionary of property text to value.

Tags: snapshot version compare delta diff baseline history changes guid properties

Model.Statistics

Counts items per model file, class or layer: how many items, how many carry geometry and each group's share of all items. With no items wired it walks every item of the document once, so on a large federated model it takes a while (O(items)); "layer" also reads one property per item. A wired list that is empty, such as a search that found nothing, counts nothing: you get an empty table (headers only) and a warning, never the whole document by accident.

Inputs

Input Type Default What it does
items any number of wires ModelItem[] null The items to count. Leave it unwired to count every item of the document; a wired list that is empty (a search that found nothing) counts nothing and gives an empty table.
by string "model" What to group by: "model" (the file the item belongs to), "class" (its class name, such as Layer or Geometry) or "layer" (its Item > Layer property).
document Document null The document (defaults to the active document); only used when no items are given.

Outputs

Output Type What it gives
table CamelGraphTable A table with the columns Group, Items, WithGeometry and Share (percent of all items, one decimal), the biggest group first.

Tags: model statistics count health inventory summary items geometry class layer file size breakdown

Models.RootItems

The root model items of every model loaded in a document, read again on every run.

Inputs

Input Type Default What it does
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
rootItems ModelItem[] One root item per loaded model.

Tags: models roots items tree