.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MEP - List of Fittings/MvParts by Name

1 REPLY 1
Reply
Message 1 of 2
mhillis
251 Views, 1 Reply

MEP - List of Fittings/MvParts by Name

Hey guys,

 

I think I already know the answer to this question, but I wanted to double check and make sure.

 

Does the MEP API have any means, natively, of getting a list of all the Default MEP Duct Fittings/Related MvParts (like Terminals) preferably by name.

 

I realize that I can read the MvPart folders within the AutoCAD install directory, and just pull the list that way, but if there is a way within the API itself I didn't want to repeat work that's already been done.

 

Thanks!

 

1 REPLY 1
Message 2 of 2
mhillis
in reply to: mhillis

Update: For now, I've chosen just to read the catalog file directly. Since it's an XML, it's pretty simple.   I'm just interested in the optimal means of doing this. Smiley Happy

 

Dim xDoc As New XmlDocument
            xDoc.Load("C:\ProgramData\Autodesk\MEP 2016\enu\MEPContent\USI\Duct\Duct (US Imperial).apc")

            Dim chapNodes As XmlNodeList =
                xDoc.GetElementsByTagName("Chapter")

            For Each priChapNode As XmlNode In chapNodes
                For i As Integer = 1 To priChapNode.ChildNodes.Count - 1

                    Dim xChild As XmlNode = priChapNode.ChildNodes(i)

                    If (xChild.Name = "Part") Then
                        Dim partName As String = xChild.Attributes("name").Value()

                        cmbMEPFitting.Items.Add(partName)

                    End If
                Next
            Next

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report