# Move elements from view to another one

**URL:** <https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390>\
**Category:** Revit\
**Created:** [November 20, 2019, 10:39am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390 "2019-11-20T10:39:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rinag](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rinag/32/75084_2.png) [@rinag](https://forum.dynamobim.com/u/rinag)\
**Post date:** [November 20, 2019, 10:39am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/1 "2019-11-20T10:39:43Z")

</div>

Hi,  
I’m creating a detail lines from Rebar element in section view and i want to move them to plan view ,  
is there a way to do that?  
the result i expect to create 2D lines from Beams rebar in plan.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/05181639d8e187455ed6af40902b5fcaf52c54c6.png)

---

<div class="post-metadata">

**Author:** ![Tom\_Kunsman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/tom_kunsman/32/133796_2.png) [@Tom\_Kunsman](https://forum.dynamobim.com/u/Tom_Kunsman)\
**Post date:** [November 20, 2019, 11:50am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/2 "2019-11-20T11:50:09Z")

</div>

can you please post the DYN and the Python code here on the forum? It will be easier to read and to help you. Thanks.

---

<div class="post-metadata">

**Author:** ![rinag](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rinag/32/75084_2.png) [@rinag](https://forum.dynamobim.com/u/rinag)\
**Post date:** [November 20, 2019, 12:17pm UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/3 "2019-11-20T12:17:20Z")

</div>

[2DBeamRebarInPlan.dyn](https://forum.dynamobim.com/uploads/short-url/trXpPYz3aq2naabLwSjh4XOdoYO.dyn) (40.6 KB)

---

<div class="post-metadata">

**Author:** ![stillgotme](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stillgotme](https://forum.dynamobim.com/u/stillgotme)\
**Post date:** [November 21, 2019, 8:03am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/4 "2019-11-21T08:03:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/3/e33b2733d69193fedb63965991aa0b4030470584.png)

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import ToProtoType, ToRevitType geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

# Import DSCore nodes in Dynamo
clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *

# Import python library
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import os
import shutil
import math
# Import math library
from math import *

#Import Data and Time
from datetime import datetime
now = datetime.now()

#Import System Library
import System
from System.Collections.Generic import *
from System.IO import Directory, Path

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

#Preparing input from dynamo to revit
elements = UnwrapElement(IN[0])
Dview = UnwrapElement(IN[2])
Sview = UnwrapElement(IN[1])
Transform = UnwrapElement(IN[3])
elementid = List[ElementId]()
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for element in elements:
	Sview = doc.GetElement(element.OwnerViewId)
	elementid.Add(element.Id)

copied = False
try:
	copied = True
	ElementTransformUtils.CopyElements(Sview,elementid,Dview,Transform,CopyPasteOptions())
except:copied = False

moved = "False"
if copied:
	doc.Delete(elementid)
	moved = "True"
TransactionManager.Instance.TransactionTaskDone()
#Final output
OUT = moved
```

---

<div class="post-metadata">

**Author:** ![rinag](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rinag/32/75084_2.png) [@rinag](https://forum.dynamobim.com/u/rinag)\
**Post date:** [November 24, 2019, 6:23am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/5 "2019-11-24T06:23:58Z")

</div>

Hi,  
what this code supposed to do?

---

<div class="post-metadata">

**Author:** ![stillgotme](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stillgotme](https://forum.dynamobim.com/u/stillgotme)\
**Post date:** [November 25, 2019, 1:04am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/6 "2019-11-25T01:04:50Z")

</div>

copy from drafting view to floorplan? thats what you need right?

---

<div class="post-metadata">

**Author:** ![rinag](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rinag/32/75084_2.png) [@rinag](https://forum.dynamobim.com/u/rinag)\
**Post date:** [November 25, 2019, 8:25am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/7 "2019-11-25T08:25:48Z")

</div>

right to structural plan,  
it doesnt work for me ,  
could u please show me how it works for you ?

---

<div class="post-metadata">

**Author:** ![stillgotme](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stillgotme](https://forum.dynamobim.com/u/stillgotme)\
**Post date:** [November 26, 2019, 1:02am UTC](https://forum.dynamobim.com/t/move-elements-from-view-to-another-one/43390/8 "2019-11-26T01:02:45Z")

</div>

erm, so basically IN[0] is your detailed lines, IN[1] is the view where your detailed lines reside, IN[2] is the view that you want your detailed line to be copied to, and IN[3] is the transformation (basically the coordinates to shift it up down left right)
