It seems that many of the DWG files I am appending into a composite model reference each other. I would like to ignore the X-REFs when appending the file. Is there a way to do that?
If I can not exclude them on the append, can I remove the layers from the external references once appended? I created a search like this:
items = Autodesk.Navisworks.Api.
Application.ActiveDocument.Models.GetRootItems().DescendantsAndSelf.Where(x => x.IsLayer && (x.DisplayName.Contains("|")));
I am unsure of the .NET or COM syntax to remove the layers and their contents from this point.
Has any thought been given to creating a pre process script that will remove all x-refs from the dwg?
I am quite sure you can remove all Xref's thru an AutoLisp routine. You could even compose\download a utility that would Generate The Script Then execute script.
Thank you for the sugestion. I think it woud be more effecient to be able to set the File Reader option that you find in global options which allows you to turn off X-REFS. Or importing a Global Options file that has that option specified. I have not been able to find how to do either of these in the COM help or the API help.
The only way I know of to do this is to manually set the Global Options. In Options go to File Readers, then DWG/DXF then Uncheck Convert XRefs. If someone has a suggestion as to how to do this with the API. I am eager to hear it as well.
Access a broad range of knowledge to help get the most out of your products and services.