AnsweredAssumed Answered

Create a function in Wrapper

Question asked by claudio on Jun 14, 2016
Latest reply on Jun 15, 2016 by John Messinger

We create a function that returns the path element as follows:

[ComVisible(true)]

        public string GetPathByName(string fullElementName)

        {

            PISystem myPISystem = new PISystems().DefaultPISystem;

            NetworkCredential credential = new NetworkCredential("user", "password");

            myPISystem.Connect(credential);

            AFDatabase myDB = myPISystem.Databases.DefaultDatabase;

            var myElements = AFElement.FindElements(

            myDB, null, fullElementName, AFSearchField.Name,

            true, AFSortField.Name, AFSortOrder.Ascending, 1);

            myPISystem.Disconnect();

            if (myElements != null && myElements.Count > 0)

            {

                return myElements[0].GetPath();

            }

            else

            {

                return null;

            }

        }

 

How do I get an associated tag name, passing the path of the element obtained in the previous function?

 

Thanks for listening !

Outcomes