Navisworks API

Navisworks API

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

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

246 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 (235 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 (233 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 (229 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.

Active Contributor
deanlyon
Posts: 27
Registered: ‎12-10-2007
Message 5 of 5 (161 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!