Revit API

Reply
Active Contributor
skeletank
Posts: 26
Registered: ‎08-25-2010
Message 1 of 3 (267 Views)
Accepted Solution

Remove links without opening the model

267 Views, 2 Replies
11-11-2013 08:46 AM

Is there any way in the Revit API to remove links from a model without opening it?

I know that I can use the transmission data class to modify the paths of links with opening the models but I would like to remove the links as well without needing to open the models.  Is this possible?

 

NOTE: I am using Revit 2014 API.  


Removing links is not supported.
As the document for TransmissionData class says, TransmissionData cannot add or remove references to external files.. Set the last parameter to false.

But you can use this class to prevent Revit from loading some references by this method:
public void SetDesiredReferenceData(
ElementId elemId,
ModelPath path,
PathType pathType,
bool shouldLoad
)

ADN Support Specialist
Joe.Ye
Posts: 334
Registered: ‎03-05-2010
Message 2 of 3 (232 Views)

Re: Remove links without opening the model

11-18-2013 07:26 AM in reply to: skeletank

Removing links is not supported.
As the document for TransmissionData class says, TransmissionData cannot add or remove references to external files.. Set the last parameter to false.

But you can use this class to prevent Revit from loading some references by this method:
public void SetDesiredReferenceData(
ElementId elemId,
ModelPath path,
PathType pathType,
bool shouldLoad
)



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Active Contributor
skeletank
Posts: 26
Registered: ‎08-25-2010
Message 3 of 3 (226 Views)

Re: Remove links without opening the model

11-18-2013 08:33 AM in reply to: Joe.Ye

Hi Joe,

 

I am aware that you cannot remove the links using the TransmissionData class but I was hoping that there was a way to do it without opening the document by using a separate part of the API.  However, I missed the part about setting the links up so that they are unloaded by default.  That can be useful in itself.

 

Thanks,

Matt 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.