Is it posible to delete or remove an appended model? I cant find any obvious was through the .NET api. Thanks.
Hi,
please see this blog:
http://adndevblog.typepad.com/aec/2013/01/delete-or-remove-an-appended-model.html
Whats the dumb down way to delete apended files in Navisworks. In 2013 I could right click delete? 2014 has no option to delete. I am in a Nwf file.
Hi,
although this sounds like a product question, I checked Nw2014 quickly. It looks the [delete] is still avaiable there. is this what you are looking for?
hy all,
Is there another way to remove an appended model file without use Autodesk.Navisworks.Api.Interop.ComApi state.DeleteSelectedFiles() method?
this comAPI method not work properly on Naviswors 2022.
Rolando
this is my mplementation method:
public void RemoveModelFromDocument(Autodesk.Navisworks.Api.Document doc, Autodesk.Navisworks.Api.Model modello)
{
if(modello != null)
{
try
{
doc.CurrentSelection.CopyFrom(modello.RootItem.AncestorsAndSelf);
Autodesk.Navisworks.Api.Interop.ComApi.InwOpState10 state =
ComApiBridge.State;
state.DeleteSelectedFiles();
}
catch (Exception e)
{
throw e;
}
}
}
when state.DeleteSelectedFiles() was called it raise an "Naviswork unknown error" exception. If I remove throw e; line model in not removed from document.
Rolando
In the above code I substitute selection with this line of code:
doc.CurrentSelection.CopyFrom(new List<ModelItem>() { model.RootItem });
but the same Exception is always raised.
In the meantime I have found a solution. I discovered that this exception is raised when the model I want to remove is the unique model in document's model list. Therefore I append a new model and after I can remove the old model and all work fine.
Thanks a lot for your suggestion.
Rolando
Rolando