cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute command "Load entity level" in API

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

 

Question:

 

“How to execute command "Load entity level" in API ? “

I tried to check such function in Help, but I cannot find it.

Pls suggest

 

Answer:

 

Load Entity Level can be called from the .NET API using the following code (example):

 

    ITxObject obj = TxApplication.ActiveSelection.GetItems()[0];
    ITxStorable storableObj = obj as ITxStorable;
    if (storableObj != null)
    {
        TxLibraryStorage libraryStorageObject = storableObj.StorageObject as TxLibraryStorage;
        if ((libraryStorageObject != null) && libraryStorageObject.HasDetailedRepresentation)
        {
            try
            {
                if ((obj as ITxComponent).RepresentationType == TxRepresentationType.United)
                {
                    libraryStorageObject.Reload(TxRepresentationLevel.Detailed);
                }
            }
            catch (Exception e)
            {
                 ... 
            }

        }

    }