Cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Teamcenter preference from NX Open Code

Creator
Creator

Hello Experts,

 

Can we read the Teamcenter preference from NX open code. Is there any API available in UF_UGMGR Functions to read TC preference from NX open.

 

Thanks.

 

3 REPLIES

Re: How to read Teamcenter preference from NX Open Code

Pioneer
Pioneer

hi

 

I'm not quite sure what you mean by "Teamcenter preference " ,

but in "uf_ugmgr.html" all the good stuff is described in a good manner .

 

lklo

Re: How to read Teamcenter preference from NX Open Code

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

You can use invoke PDM server call API which will execute Teamcenter ITK code. ITK can read Teamcenter preference and return its value. I am not sure if there is any direct API which can give you Teamcenter preference value. 

Re: How to read Teamcenter preference from NX Open Code

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

This might be 4 year late but here you go. This is a method that gets a preference service and grabs the last value for a specified preference:

 

Service:

  public static Teamcenter.Services.Strong.Administration.PreferenceManagementService PrefService
        {
            get
            {
             return Teamcenter.Services.Strong.Administration.PreferenceManagementService.getService(TCSession.GetConnection());
            }
        }

Method:

 

        public static string GetSitePreference(string preferenceName)
        {
            Teamcenter.Services.Strong.Administration._2012_09.PreferenceManagement.GetPreferencesResponse preferenceResp =
                 TCProgram.PrefService.GetPreferences(new[] { preferenceName }, true);
            return preferenceResp.Response.LastOrDefault().Values.Values.LastOrDefault();
        }