EPLAN API 入门系列- 提高篇(How to get PartProperty via partNo)

 How to get PartProperty via partNo?

        public ArrayList BDGetProPartProperty(Project oProject, string PartNO)

        {

            ArrayList arrList = new ArrayList();



            DMObjectsFinder oFinder = new DMObjectsFinder(oProject);

            FunctionsFilter oFunctionsFilter = new FunctionsFilter();

            oFunctionsFilter.ExactNameMatching = true;

            Function[] oFunctions = oFinder.GetFunctions(oFunctionsFilter);

            foreach (var oFunction in oFunctions)

            {

                if (oFunction != null)

                {

                    foreach (var part in oFunction.Articles)

                    {

                        if (part.Properties.ARTICLE_PARTNR == PartNO)

                        {

                            string sDescription1 = string.Empty;



                            if (!part.Properties.ARTICLE_DESCR1.IsEmpty)

                            {

                                sDescription1 = ((MultiLangString)part.Properties.ARTICLE_DESCR1).GetString(ISOCode.Language.L_zh_CN);

                            }



                            arrList.Add("名称1||" + sDescription1);

                        }

                    }

                }

            }

            return arrList;

        }

  

 

你可能感兴趣的:(property)