Function Node parameter input options - Custom GC nodes

Hi all,
Just wondering if there are any other users creating custom GC nodes? I need some help implementing the following in a 'Function' type node:

  • OpenFileDialog for Node input parameter - to select a file
  • Drop-down list for Node input parameter - I want to populate with the available models inside of the above selected file
  • How to add Microstation Elements to a Feature node output, eg. Bentley.DgnPlatformNET.Elements.CurveElement -> ICurve on the node output

If anyone has examples of how to achieve this that would be much appreciated!

Thanks in advance,


Ed

Parents
  • Hi Ed,

    These are very interesting requirements. We are checking this internally.

  • Hi Alifur,

    Perhaps it might help speed things up if I simplify the question regarding adding elements to node output; how can I instead set multiple features in a single technique and have them accessible by list index for each? Currently I have found the following issues:

    • I can add all the Microstation elements as a feature using SetElements(IEnumerable<Element>) however this results in all of the elements being added as the same list index. For example, there are 5 elements contained within parametricCell1[1], when returning the child elements of this cell all 5 elements are on the same list index parametricCell2[1]. I need them to form a nested list eg. {parametricCell[1][0],parametricCell[1][1],parametricCell[1][2],parametricCell[1][3],parametricCell[1][4]} so that they are able to be accessed individually.
    • I can add the elements individually using the SetElement(<Element>) however this results in only one element being output

    Example of SetElements workflow:

    List<IElement> newElements = new List<IElement>();
    
    try
    {
        foreach (Element el in extracted)
        {
            el.AddToModel(); //Add cell child element to the active model (DgnPlatformNET Element type) 
            IElement ele = MSApp.ActiveModelReference.GetLastValidGraphicalElement(); //Retrieve the child element (Interop Element Type)
            newElements.Add(ele); //Add to the list of newly created elements
        }
    
        IEnumerable<IElement> ie = newElements; //Create IEnumerable to set multiple elements as a GC Feature
        SetElements(ie); //Creates all elements, however they are on the same index, not nested objects in the list for that cell instance
    }

    Thanks,

    Ed

Reply
  • Hi Alifur,

    Perhaps it might help speed things up if I simplify the question regarding adding elements to node output; how can I instead set multiple features in a single technique and have them accessible by list index for each? Currently I have found the following issues:

    • I can add all the Microstation elements as a feature using SetElements(IEnumerable<Element>) however this results in all of the elements being added as the same list index. For example, there are 5 elements contained within parametricCell1[1], when returning the child elements of this cell all 5 elements are on the same list index parametricCell2[1]. I need them to form a nested list eg. {parametricCell[1][0],parametricCell[1][1],parametricCell[1][2],parametricCell[1][3],parametricCell[1][4]} so that they are able to be accessed individually.
    • I can add the elements individually using the SetElement(<Element>) however this results in only one element being output

    Example of SetElements workflow:

    List<IElement> newElements = new List<IElement>();
    
    try
    {
        foreach (Element el in extracted)
        {
            el.AddToModel(); //Add cell child element to the active model (DgnPlatformNET Element type) 
            IElement ele = MSApp.ActiveModelReference.GetLastValidGraphicalElement(); //Retrieve the child element (Interop Element Type)
            newElements.Add(ele); //Add to the list of newly created elements
        }
    
        IEnumerable<IElement> ie = newElements; //Create IEnumerable to set multiple elements as a GC Feature
        SetElements(ie); //Creates all elements, however they are on the same index, not nested objects in the list for that cell instance
    }

    Thanks,

    Ed

Children
No Data