Can I copy elements to *.rfa?

Can I copy elements to *.rfa?

jinho_won
Participant Participant
303 Views
2 Replies
Message 1 of 3

Can I copy elements to *.rfa?

jinho_won
Participant
Participant

Hello~

 

ElementTransformUtils.CopyElements can only be copied to *.rvt.

And can I copy elements to *.rfa?

I want to know how to copy elements to *.rfa.

 

thanks.

 

 

0 Likes
304 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

> ElementTransformUtils.CopyElements can only be copied to *.rvt.

  

What makes you say so? That is news to me, and I find it hard to believe.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

jinho_won
Participant
Participant

I'm sorry my question is weird.

I want to copy the DirectShape from the A.rvt file to B.rfa.

 

However, when I try to copy it to rfa using ElementTransformUtils.CopyElements, I get an exception.

 

... ...
Document rvtDoc = commandData.Application.ActiveUIDocument.Document;
Document rfaDoc = uiapp.Application.NewFamilyDocument("C:/ProgramData/Autodesk/RVT 2024/Family Templates/English/Metric Generic Model.rft");
ICollection<ElementId> ids = uiapp.ActiveUIDocument.Selection.GetElementIds();
using (Transaction tr = new Transaction(rfaDoc, tr_name))
{
    tr.Start();
    ElementTransformUtils.CopyElements(rvtDoc, ids, rfaDoc, Transform.Identity, copyOptions);
    tr.Commit();
}
... ...

 

 

DirectShape 복사 에러.png

 

 

Is it not possible to copy elements between RVT and RFA?

 

 

0 Likes