# Geometry from linked file, by shared coordinates, appears on the wrong place in Dynamo

**URL:** <https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351>\
**Category:** Geometry\
**Created:** [September 18, 2021, 1:05pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351 "2021-09-18T13:05:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [September 18, 2021, 1:05pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/1 "2021-09-18T13:05:23Z")

</div>

So I have a file with geometry, linked by Shared Coordinates, while my rooms are in the host model:

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

However, after selecting all the rooms’ geometry and doors, windows, walls, etc from the geometry file, they appear to be on completely different places:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/1/21a3d9917085c647782600711126a621e4b15443.png)

Any ideas why? 🙂 I am trying to calculate the areas of room finishes in the case with linked geometry and rooms in a host model. Everything seemed to work fine, until I tried with a project, where links are placed by shared coordinates.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [September 18, 2021, 1:55pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/2 "2021-09-18T13:55:48Z")

</div>

The position of the elements is calculated from the origin.  
Revit’s origin and Dynamo’s origin match, you only need to translate it in coordinates from your Shared Coordinate.  
The are some nodes in the GeniusLoci package to get it back in position.

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [September 18, 2021, 2:59pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/3 "2021-09-18T14:59:18Z")

</div>

Thx, I will give it a try

---

<div class="post-metadata">

**Author:** ![ScottL](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@ScottL](https://forum.dynamobim.com/u/ScottL)\
**Post date:** [September 19, 2021, 3:35am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/4 "2021-09-19T03:35:51Z")

</div>

I recently solved this problem by writing a short python script that gets the linked model’s totaltransform then converting that to a vector and translating the linked element’s location along this vector.

[https://www.revitapidocs.com/2015/8c8aff2b-5ff9-e43a-3b5c-308cd0174f1f.htm](https://www.revitapidocs.com/2015/8c8aff2b-5ff9-e43a-3b5c-308cd0174f1f.htm)

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [September 20, 2021, 7:02am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/5 "2021-09-20T07:02:09Z")

</div>

That’s cool, could you please share the script?

I tried different options and I still can’t get it to work, here is the geometry from the host model (blue) and the one from the geometry model (red). You can see the different transforms and none of them intersect:

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

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

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

From what I see, I can only get it to translate the geometry in Z direction, it does not detect X and Y difference in coordinates.

---

<div class="post-metadata">

**Author:** ![ScottL](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@ScottL](https://forum.dynamobim.com/u/ScottL)\
**Post date:** [September 21, 2021, 7:07pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/6 "2021-09-21T19:07:33Z")

</div>

Sorry for the delay, here’s the python code which takes a document (linked instance) as input and outputs the linked document’s total transform as a point.

```auto
#Written by Scott Lebow
import clr

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

linkInst = UnwrapElement(IN[0])

totalTransform = linkInst.GetTotalTransform()
origin = XYZ(0, 0, 0)
offsetPoint = totalTransform.OfPoint(origin)

#Assign your output to the OUT variable.
OUT = offsetPoint.ToPoint()

```

From here you can create a Vector using this point (linkOffsetPoint).  
DesignScript:  
`linkOffsetVector = Vector.ByTwoPoints(Point.ByCoordinates(0, 0, 0), linkOffsetPoint);`

Or with nodes:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/b/fb1da67458f6d5ebdbaecb153cc214dc06761758.png)

Then you can translate your point along this vector using Designscript:

```auto
newLocations = Point.Add(linkedElements.Location, linkOffsetVector);

```

Or the Point.Add node:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68a8d3120f33003073a9efd10e6359a1be6b105c.png)

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [September 23, 2021, 8:46am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/7 "2021-09-23T08:46:45Z")

</div>

Thx, Scott! That brought me as close as I could get so far:

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

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

However, there is still a weird rotation angle, while the BasePoint reports that angle to true north is set to 0…:

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

I am now trying to find out where that comes from 🙂

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [September 23, 2021, 8:51am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/8 "2021-09-23T08:51:33Z")

</div>

Try BimorphNodes LinkElements they already include built-in logic to handle the transformation of linked elements and their geometry in the host document.

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [September 23, 2021, 10:33am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/9 "2021-09-23T10:33:52Z")

</div>

I tried that initially. I finally got what I needed from GeniusLoci’s Get Project Locations node. For some reason, nothing else could read the True North correctly:

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

The node also reads the coordinates as it should - returns identical values with the one from Scott’s script. So I will just use that one.

I’m glad it finally works, but I will need to dig deeper and find out why so many nodes failed for this file. Could it be related to the new internal origin in 2021 somehow? Thx to everyone for the support

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [September 23, 2021, 10:56am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/10 "2021-09-23T10:56:50Z")

</div>

Its a problem with the Python script as it converts the transform to a translation and you need the former not the latter to position the geometry correctly. You could convert the transform to a Dynamo CS in Python using `ToCoordinateSystem()` or achieve your workflow with significant performance improvements using two BimorphNodes:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/6/9600bab0559904a8a9cec7e7fa0225f8b6b79d9d.png)

---

<div class="post-metadata">

**Author:** ![MrTabsTabs](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@MrTabsTabs](https://forum.dynamobim.com/u/MrTabsTabs)\
**Post date:** [May 10, 2022, 1:26am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/11 "2022-05-10T01:26:45Z")

</div>

I wanted to thank Danail momchilov, ScottL and Tomas mahon for their contributions, I was dealing with this issue all afternoon and I finally managed to get the revitlinkinstances geometry location in my host model. If I get consent from my work staff I can publish my script which transforms all walls from links into Dynamo solids with original rotation and xy translation . Thankyou so much.

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [May 10, 2022, 10:53am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/12 "2022-05-10T10:53:27Z")

</div>

Diving further after this topic and as an alternative to the solution Thomas provided, I found a node from the amazing archi - lab package, that lets you select elements from linked models directly and returns the total transform as well:

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

you could then get their geometry and use the transform to get them on their right location:

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

Just thought it might come usefull to you, for me this workflow works quite well.

Based on SelectLinkedElements node, I created a simplification of the code, that lets you select only a link instance and returns its transform, might be usefull to you also:

```auto
"""
based on a simplification of the 
SelectLinkedElements node in archi-lab package

original copyrights:
Copyright(c) 2017, Dimitar Venkov
@5devene, dimitar.ven@gmail.com
www.badmonkeys.net
"""

import clr

clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import RevitLinkInstance

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

sel1 = uidoc.Selection
ot1 = Selection.ObjectType.Element
ot2 = Selection.ObjectType.LinkedElement
li_ref = sel1.PickObject(ot1, "Please, select a link instance.")
link1 = doc.GetElement(li_ref.ElementId)

if isinstance(link1, RevitLinkInstance):
	OUT = link1, link1.GetTotalTransform().ToCoordinateSystem(True)
else:
	OUT = 'Link instance not selected...100 tei prai6'

```

Cheers

---

<div class="post-metadata">

**Author:** ![MrTabsTabs](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@MrTabsTabs](https://forum.dynamobim.com/u/MrTabsTabs)\
**Post date:** [May 17, 2022, 8:57pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/13 "2022-05-17T20:57:58Z")

</div>

Hi

Thanks for your contribution, I have tried using the transform.TocoordinateSystem() method.Its working very slowly so Im using the bimorph nodes and it seems to be faster.Are you using the archilab package and then transforming elements to designscript geometries? and/or the bimorph nodes? Do you which procedure is faster?

Thanks

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [May 18, 2022, 6:34am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/14 "2022-05-18T06:34:53Z")

</div>

I depends on what you are trying to achieve. I have been using both for different purposes. The [archi-lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) node lets you select only certain elements from the link instance. Then in combination with geometry.transform node it works quite well for me (and fast). In case I need a whole category of elements from the link, I would definitely use Bimorph.

I didn’t get the designscript part, what do you mean? What are you trying to achieve? Getting elements’ geometry or solids is actually a quite slow process.

---

<div class="post-metadata">

**Author:** ![MrTabsTabs](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@MrTabsTabs](https://forum.dynamobim.com/u/MrTabsTabs)\
**Post date:** [May 18, 2022, 6:45pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/15 "2022-05-18T18:45:09Z")

</div>

When you use the Geometry.Transform method you are converting elements to Autodesk.DesignsScript.Geometry.Solids , I find that this solid conversion method is slow(I have almost 6 linkInstances containing 1800 walls and its taking 1.5 minutes for this process to finish) .Im trying to extract walls from revit link instances and ive done so with the Transform.ToCoordinateSystem() + Geometry.Transform method and the bimorph nodes method using LinkElement.ByCategory. I wanted to compare these methods and ask you about the archilab package method, which I will try to also use and compare speed times with the other 2 methods that I mentioned .

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [May 19, 2022, 6:20am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/16 "2022-05-19T06:20:05Z")

</div>

I see. One of the tasks I am using this workflow for, is structural openings in floors. In this case, I would get all elements’ bounding boxes (since I need rectangular openings anyway) and then use boundingbox.tocuboid node to get the solids of their bounding boxes. Only then I transform the geometry and it works well and fast. I just dont know if this would work fine in your case. If you would test it someday, please let me know what’s the result 🙂

---

<div class="post-metadata">

**Author:** ![CUIXIAOnz](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@CUIXIAOnz](https://forum.dynamobim.com/u/CUIXIAOnz)\
**Post date:** [February 5, 2023, 9:11am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/17 "2023-02-05T09:11:29Z")

</div>

Thanks Dan,

The Geometry.Transform worked perfectly for me! it makes all the linked model use the project origin to operate other nodes, I was trying to get intersections, the MEP model and walls were miles away from each other in Dynamo.

Thanks again for your time

Cathy

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 5, 2023, 4:06pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/18 "2023-02-05T16:06:57Z")

</div>

thank you ! glad you found it useful

edit: it’s actually Dimitar Venkov we should all thank

---

<div class="post-metadata">

**Author:** ![Qnguyen2688](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/qnguyen2688/32/103573_2.png) [@Qnguyen2688](https://forum.dynamobim.com/u/Qnguyen2688)\
**Post date:** [February 20, 2023, 8:45pm UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/19 "2023-02-20T20:45:54Z")

</div>

Hi I use BIMorpthNodes but the room perimeters from linked model return in host model as shifted. Can you please help ?

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

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 21, 2023, 7:09am UTC](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351/20 "2023-02-21T07:09:03Z")

</div>

Hi, try using the code that I posted, it lest you select the link and gets its transform, then you can move the link’s rooms geometry on the correct location, based on that transform. Check my last post.

[Next page](https://forum.dynamobim.com/t/geometry-from-linked-file-by-shared-coordinates-appears-on-the-wrong-place-in-dynamo/68351.md?page=2)
