FindSlide.org - это сайт презентаций, докладов, шаблонов в формате PowerPoint.
Email: Нажмите что бы посмотреть
ModelItem
ModelItem root = model.RootItem;
bool is_hidden = root.IsHidden;
//iterate over the selected Items
foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.
CurrentSelection.SelectedItems)
{
//Add the children of the selected item to a new collection
newCollection.AddRange(item.Children);
}
//iterate over the selected Items
foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.
CurrentSelection.SelectedItems)
{
//Add the Descendants of the selected item to a new collection
newCollection.AddRange(item.Descendants);
}
// check if the bounding box of two items are intersected
ModelItemCollection oSelItems = doc.CurrentSelection.SelectedItems;
ModelItem oItem1 = oSelItems.ElementAt
ModelItem oItem2 = oSelItems.ElementAt
bool isIntersect = oItem1.Geometry.BoundingBox.Intersects(
oItem2.Geometry.BoundingBox);
Override Color to Red
Original Color = White
Active Color = Red
Permanent Color = Red
Not Save File, Reset
Original Color = White
Active Color = White
Permanent Color = White
After Save File,
Override Color to Green
Original Color = Red
Active Color = Green
Permanent Color = Green
Not Save File, Reset
Original Color = Red
Active Color = Red
Permanent Color = Red
//change the color of selected items to red
doc.Models.OverridePermanentColor(doc.CurrentSelection.SelectedItems, Color.Red);
//change the transparency of the current selection to 0.5
doc.Models.OverridePermanentTransparency( doc.CurrentSelection.SelectedItems,0.5);
Document doc = Autodesk.Navisworks.Api.Application.MainDocument;
// current selection
ModelItemCollection coll = doc.CurrentSelection.SelectedItems;
//build a vector for moving, along
Vector3D oNewVector3d = new Vector3D(1, 1, 0);
// orthogonal transforms + translation
//build an identity matrix which represents orthogonal transforms
Matrix3 oNewIndentityM = new Matrix3();
//create a transform from a matrix with a vector.
Transform3D oNewOverrideTrans = new Transform3D(oNewIndentityM, oNewVector3d);
//override the transformation of the selection
doc.Models.OverridePermanentTransform(coll, oNewOverrideTrans, true);
//reset appearance of selected items
doc.Models.ResetPermanentMaterials(doc.CurrentSelection.SelectedItems);
//reset transform of selected items
doc.Models.ResetPermanentTransform(doc.CurrentSelection.SelectedItems);
//reset hidden status of all items
doc.Models.ResetAllHidden();