Pass Elemnt from Document to another Revit Api c#
Hey,I'm trying to make copy from family Document contain Extrusion (the Element i want to select ) and make copy of it in another Document "I mean there is two opened Documents where i select the element from the family file and paste it in another project file ".
My Code Sequence:
1.Make User selects the Element.
2.get Element ID and get its location
3.Make the user select the palce where he wants to make a copy of the element "it may be another Document" so before this ,I get the Active Document .
4.copy command by elemnt id and new position enetered by user.
The Problem is :
the active document command raises an exception with selection command and Now i don't know how to solve this issue?
, also is it will be IExternalApplication or IExternalCommand?
and why when i load family in my document ,the family not appears?
Please Help me .
Thanks In Advance :)
Re: Pass Elemnt from Document to another Revit Api c#
Which version of Revit? What is exacty the exception? Please provide us more details and don't ask several questions on a single thread.
Re: Pass Elemnt from Document to another Revit Api c#
first i'm sorry for asking several questions in the same thread but i'm new to Revit Programming so i need some guidness. I use Revit Arch 2012.
The Exception from pickObj because using of " _doc = commandData.Application.ActiveUIDocument.Document;" when press in another revit document.
Can you Help me please?
Re: Pass Elemnt from Document to another Revit Api c#
I don't believe that you can do this on 2012. The API for transferring elements from one document to an other has been introduced in 2014: http://thebuildingcoder.typepad.com/...assertion.html. What you can do is perhaps creating a new element and copy the values of the source parameters. See also: http://adndevblog.typepad.com/aec/20...s-via-api.html