I noticed you opened up Tech Support Case # 617844 for this issue. Do you have any additional questions after working with our Tech Support Engineer?
We do have a few Developer Tools that can be used to interact with both SQL and AF server. However, most of them (e.g. PI OLEDB Enterprise) only allow read access to the AF database. As you have mentioned, PI AF SDK will be a valid option for your use case since it allows both read/write access and offers a variety of functionality. You also mentioned that the production hierarchy could change, so a custom .NET application could update the AF hierarchy when any change has happened.
Apart from the AF SDK tutorials in the Master PI space, do download the AF SDK Developer tools from the Tech Support download center (related discussion here: PI AF SDK Programming References). After installation, you can find the full list of AF SDK programming references at %pihome%\help\afsdk.chm.
Hope it helps! Do keep us in the loop and we will be happy to answer any specific development questions you have.
I received a response to this thread in the general PI Square mailbox instead of from the forum. In general, the forum space is highly monitored (as compared to the PI Square mailbox), so you will get a faster response if replying to this thread directly! Nonetheless, I have pasted your questions and my answers for continued discussion in this forum:
Here our focus is to generate an AF Hierarchy Database based on the official company production business hierarchy which is on SQL server. Now, we want to know from you the following:
1. Which program language do you recommend to work along PI AF SDK? Can we use Visual Studio C#? Please let us know.
2. Where we can find how to reference the AF elements to be created to build the hierarchy? We can find it in the AF SDK tutorials. By chance do you have any code as example to do so.
To answer your questions:
1. Since PI AF SDK is built as a .NET library, I would recommend using a .NET language while working with PI AF SDK. C# is definitely the most common language I have seen so far; alternatively, I have also seen some instances of VB.NET. I would definitely recommend C#, but this ultimately depends on the comfort level and preference of the developer.
2. There are many sample codes in the AF SDK reference guide (available at %pihome%\help\afsdk.chm after installing the AF Developer Tools). Specifically, you will want to look at the examples under the following classes within the AF.Asset namespace for examples on how to create elements, attributes and templates:
If you have specific development questions, I will also be able to provide more code samples.
Hope it helps! Let me know if you have any questions.