Navisworks API

Reply
Active Member
x2dalyon
Posts: 10
Registered: ‎11-22-2011
Message 1 of 5 (232 Views)

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

232 Views, 4 Replies
01-04-2012 01:36 PM

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?

Active Member
x2dalyon
Posts: 10
Registered: ‎11-22-2011
Message 2 of 5 (221 Views)

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

01-06-2012 05:59 AM in reply to: x2dalyon

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.

Contributor
KempCE
Posts: 18
Registered: ‎08-02-2011
Message 3 of 5 (219 Views)

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

01-06-2012 08:13 AM in reply to: x2dalyon

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

 

Active Member
x2dalyon
Posts: 10
Registered: ‎11-22-2011
Message 4 of 5 (215 Views)

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

01-06-2012 09:08 AM in reply to: KempCE

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.

Contributor
deanlyon
Posts: 22
Registered: ‎12-10-2007
Message 5 of 5 (147 Views)

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

06-25-2012 07:03 AM in reply to: x2dalyon

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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community