Lacing on Custom Component question

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).

        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!

Hi @john_pierson & @Aaron_Tang.

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

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

addmit to not understanding this at all but shouldnt something like this work? How to make a lacing in Python Script - #12 by jup

Hey thanks for getting back to me John.
image

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!