Simulate 2012 .NET API - Can I append a file and exclude references?

Simulate 2012 .NET API - Can I append a file and exclude references?

Anonymous
Not applicable
1,034 Views
4 Replies
Message 1 of 5

Simulate 2012 .NET API - Can I append a file and exclude references?

Anonymous
Not applicable

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?

0 Likes
1,035 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

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.

0 Likes
Message 3 of 5

Anonymous
Not applicable

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.

 

Colin

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

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.

0 Likes
Message 5 of 5

Anonymous
Not applicable

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.

0 Likes