Linking Revit Files by Shared Coordinates

Linking Revit Files by Shared Coordinates

Anonymous
Not applicable
700 Views
3 Replies
Message 1 of 4

Linking Revit Files by Shared Coordinates

Anonymous
Not applicable

Hello,

 

I am developing a small plugin for my team. One of the tasks I need to get it working is to be able to link Revit Files. I already manage to link the files using the following method:

 

public static void LinkNewRVT()
        {
            if (!executeCode) return;

            ModelPath modelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(linkPath);

            RevitLinkOptions rlOptions = new RevitLinkOptions(false);
            var linkType = RevitLinkType.Create(doc, modelPath, rlOptions);
            
            var instance = RevitLinkInstance.Create(doc, linkType.ElementId);
        
        }

However, I cannot figure out how to create the link by Shared Coordinates.  is that option exposed by the API. This is crucial for my plugin to be of any use. 

 

 

 

Thanks in advance. 

 

 

0 Likes
Accepted solutions (1)
701 Views
3 Replies
Replies (3)
Message 2 of 4

bhprest
Advocate
Advocate
Accepted solution

Starting in Revit 2018, there is a second constructor for the RevitLinkInstance class which includes the ImportPlacement as an argument:

 

https://www.revitapidocs.com/2018/8ec3d668-271b-8333-b4d3-b56d50f4ef98.htm

 

Are you programming for an earlier version?

Message 3 of 4

Anonymous
Not applicable

Thank you mate. Really appreciate your response. 

Message 4 of 4

bhprest
Advocate
Advocate

No problem!

0 Likes