# Lacing on Custom Component question

**URL:** <https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408>\
**Category:** Developers\
**Created:** [June 6, 2023, 3:30am UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408 "2023-06-06T03:30:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilham\_MM](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@wilham\_MM](https://forum.dynamobim.com/u/wilham_MM)\
**Post date:** [June 6, 2023, 3:30am UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408/1 "2023-06-06T03:30:18Z")

</div>

Hi all,

Have a fairly specific question regarding custom node development.  
We have a series of custom components that are using the EngineController to access the input data. We have mostly inherited this method from how Speckle does it (thanks guys).

```auto
        public static T GetInputAs<T>(EngineController engine, NodeModel node, int port)
        {
            var valuesNode = node.InPorts[port].Connectors[0].Start.Owner;
            var valuesIndex = node.InPorts[port].Connectors[0].Start.Index;
            var astId = valuesNode.GetAstIdentifierForOutputIndex(valuesIndex).Name;
            var inputMirror = engine.GetMirror(astId);

            if (inputMirror?.GetData() == null) return default;

            var data = inputMirror.GetData();
            var value = RecurseInput(data);

            return (T)value;
        }

```

The issue we have run in to now is how to deal with different length list structures when using this method. By specifying exactly how to handle the data in each input we seem to be bypassing the option to use any lacing to help handle varying length lists.

Is there any way to still make use of lacing when using a method like this to access the nodes inputs? Any suggestions for alternatives when handling the data like this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![wilham\_MM](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@wilham\_MM](https://forum.dynamobim.com/u/wilham_MM)\
**Post date:** [June 13, 2023, 11:30pm UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408/2 "2023-06-13T23:30:11Z")

</div>

Hi @john_pierson & @Aaron_Tang.

I was given your names as people that may be able to advise on this. Any thoughts?

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [June 13, 2023, 11:50pm UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408/3 "2023-06-13T23:50:45Z")

</div>

Hmm. Got a few screenshots about the data structures and what’s happening?

---

<div class="post-metadata">

**Author:** ![stefan.gokstorp](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@stefan.gokstorp](https://forum.dynamobim.com/u/stefan.gokstorp)\
**Post date:** [June 15, 2023, 9:38am UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408/4 "2023-06-15T09:38:27Z")

</div>

addmit to not understanding this at all but shouldnt something like this work? [How to make a lacing in Python Script - #12 by jup](https://forum.dynamobim.com/t/how-to-make-a-lacing-in-python-script/22758/12)

---

<div class="post-metadata">

**Author:** ![wilham\_MM](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@wilham\_MM](https://forum.dynamobim.com/u/wilham_MM)\
**Post date:** [June 15, 2023, 10:38pm UTC](https://forum.dynamobim.com/t/lacing-on-custom-component-question/90408/5 "2023-06-15T22:38:29Z")

</div>

Hey thanks for getting back to me John.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/8/b81a029bc3251cda2b026dbdcbd936e1b7b311c0.png)

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

Not quite sure what the best way to show this is!

Heres a screenshot from the above code where you can see im passing 2 items in to the input. This will be the result regardless of what lacing strategy I assign. I was hoping if for example I set it to shortest - the value here would only be picking up the 11 to match with the shorter length.  
Does that mean I need to get the various length lists and manually define what happens to mismatched lengths?

Let me know if this is unclear and if theres any way I can clarify more.

Thanks again!
