Importing family types from linked model

Importing family types from linked model

jjesusdelpino
Advocate Advocate
700 Views
4 Replies
Message 1 of 5

Importing family types from linked model

jjesusdelpino
Advocate
Advocate

The main goal is set the parameter "component type" of a legend component to a type that belongs to a linked model.

 

If I try Parameter.Set(TypeId) it works only with the types that are currently to the document so I need a solution for this. I think that the good aproach is importing those families and types to the current document but Im not sure if this can be done.

 

There is a lot of LoadFamily Methods using the .rfa files but I was wondering if that same thing might be possible pointing to the family and his types directly in the linked model. I have been snooping linked elements with Revit Lookup but I havent found a way to import the families or get the .rfa path from linked model. Any ideas?

 

Thank you in advance.

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

RPTHOMAS108
Mentor
Mentor

Yes you would need the ElementId to be related to the same type in the document containing the Legend.

 

Have you tried copying between legends using:

ElementTransformUtils.CopyElements(View, ICollection<Of ElementId>, View, Transform, CopyPasteOptions).

 

A Legend component is an element showing type rather than instance. There is no specific class for Legend view or Legend component so the functionality for such is likely fairly limited.

0 Likes
Message 3 of 5

jjesusdelpino
Advocate
Advocate

Hi Thomas, thanks for your anwser. It looks that I can manually copy between legends view with both models opened. In that process, the family and the family types that I copy are imported in the first model automatically. These leads to another workflow:

 

- Open the linked model

- Creating a new legend view in the linked model

- Placing the legend components I want to copy in that legend.

- Copying those components and pasting in a view in the original model.

- Deleting the legend view in the linked model

- Closing the linked model

- Reload the linked model

- Proceed with the original workflow having already the types in the original model.

 

This has to be done for a lot of elements so Im guessing that it might be a way to just directly import the family and types desired without all the previous workflow. Specially considering that in the process of copying the legend components between views this is done automatically in the background. Thank you again.

0 Likes
Message 4 of 5

jjesusdelpino
Advocate
Advocate

 Reformuling the question. May be a way to get the rfa path of a family that belongs to a linked model? That way LoadFamily Methods could be used to insert that family and types into the original model. And therefore the types could be used in the legend component.

0 Likes
Message 5 of 5

jjesusdelpino
Advocate
Advocate
Accepted solution

Solved with ElementTransformUtils.CopyElements method. For some reason I didn´t knew that this method have an overload that allows copying between documents. It is solved.

 

 

0 Likes