# Dynamo Creating Alignment output?!

**URL:** <https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799>\
**Category:** Civil 3D\
**Created:** [November 29, 2020, 11:06am UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799 "2020-11-29T11:06:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingenieroahmad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ingenieroahmad/32/72992_2.png) [@ingenieroahmad](https://forum.dynamobim.com/u/ingenieroahmad)\
**Post date:** [November 29, 2020, 11:06am UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/1 "2020-11-29T11:06:28Z")

</div>

Please, anyone could help to return the created object “Alignment”?

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

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

---

<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:** [November 29, 2020, 12:24pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/2 "2020-11-29T12:24:24Z")

</div>

Change your methods return type from `void` to `ObjectId` then return the `civilAlignment`.

---

<div class="post-metadata">

**Author:** ![ingenieroahmad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ingenieroahmad/32/72992_2.png) [@ingenieroahmad](https://forum.dynamobim.com/u/ingenieroahmad)\
**Post date:** [November 29, 2020, 12:26pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/3 "2020-11-29T12:26:02Z")

</div>

yeah, i have tried this and it’s give me some number “45353” like id … i need the real object the alignment.

---

<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:** [November 29, 2020, 12:31pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/4 "2020-11-29T12:31:39Z")

</div>

Technically speaking ObjectId is the ‘real object’ as an ObjectId is an object from an OOP standpoint, but I’m guessing what you mean is you want the Alignment entity which the ObjectId refers to? If that is the case then the Civil3d API should have a method to obtain the element from the ObjectId; I’m not familiar with Civil3D nor its API however but if its similar to the RevitAPI then it will be something similar to this `var alignmentElement = doc.GetElement(alignmentObjectId);`.

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [November 29, 2020, 12:36pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/5 "2020-11-29T12:36:29Z")

</div>

Civil 3D and Revit APIs are very different, please stop confusing people.  
The issue is to return not the Civil 3D Alignment but rather the Dynamo wrapper of a Civil 3D Alignment.

You have many options:  
Selection.AlignmentByName(name, document);  
or  
SelectionByQuery.GetObjectByObjectHandle(alignmentObjectId.Handle.ToString());

Last, you need to use the return keyword in the definition of the node.

---

<div class="post-metadata">

**Author:** ![ingenieroahmad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ingenieroahmad/32/72992_2.png) [@ingenieroahmad](https://forum.dynamobim.com/u/ingenieroahmad)\
**Post date:** [November 29, 2020, 1:01pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/6 "2020-11-29T13:01:47Z")

</div>

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

Thank you Paolo 👍 … it’s work now 🙂

---

<div class="post-metadata">

**Author:** ![ingenieroahmad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ingenieroahmad/32/72992_2.png) [@ingenieroahmad](https://forum.dynamobim.com/u/ingenieroahmad)\
**Post date:** [November 29, 2020, 1:02pm UTC](https://forum.dynamobim.com/t/dynamo-creating-alignment-output/57799/7 "2020-11-29T13:02:09Z")

</div>

Thank you Thomas for your help 🙂 appreciate it .
