Skip to main content
View as Markdown

IModelTypeManager interface

The IModelTypeManager interface represents a repository of available model types in Altium Designer. The Implementation files (*.IMP) from the System folder of Altium Designer Installation are collected and processed by this manager.

public interface IModelTypeManager

Namespace: SCH · Assembly: Altium.SDK.Interfaces

Remarks​

Each model that can be linked to a schematic component has a model type and model data file(s).

PCB Model has one model data file - footprints (*.PCBLIB)

PCB 3D Model has one model data file -3D models (*.PCB3DLib)

Signal Integrity Model has one model data file - pin model library.

Simulation has 3 model data files - Model File(.MDL), Subcircuit file (.CKT) and SIMetrix Model Library file (*.LB).

This IModelTypeManager interface uses IModelType and IModelDataType interfaces to store different model types and their model data types.

Invoke the ModelTypeManager method to fetch the IModelTypeManager interface.

Methods​

MethodReturnsDescription
ModelDatafileTypeAtIModelDatafileTypeThis method returns the data file types supported by Altium Designer.
ModelDatafileTypeCountintThis method reports the number of model data file types used by Altium Designer.
ModelDatafileTypeFromKindIModelDatafileTypeThis method returns the IModelDatafileType based on the datafile kind.
ModelTypeAtIModelTypeThis method returns the indexed model type.
ModelTypeCountintThis method returns the number of models supported by Altium Designer.
ModelTypeFromNameIModelTypeThis method returns the model type interface based on the model type name.
ModelTypeFromServerNameIModelTypeThis method returns the model type interface based on the server name.

ModelDatafileTypeAt​

This method returns the data file types supported by Altium Designer. First data file type starts at 0. This method is used by the ModelDataFileTypes property.

IModelDatafileType ModelDatafileTypeAt(int argnIndex);
ParameterTypePassing
argnIndexintvalue

Returns: IModelDatafileType

Extension method of IModelTypeManagerHelper (using SCH;).

This property returns the data file types supported by Altium Designer. First data file type starts at 0. This property is supported by the ModelDataFileTypeAt method.

See also: IModelTypeManager.ModelDatafileTypeCount, IModelDatafileType

ModelDatafileTypeCount​

This method reports the number of model data file types used by Altium Designer. Since there are four models supported and Simulation model has 3 types while the other 3 models has one type each making 6 in total.

int ModelDatafileTypeCount();

Returns: int

Example: Show the number of model data file types.

using SCH;

IModelTypeManager modelTypeMan = EDP.Utils.LoadModelTypeManager();
if (modelTypeMan == null)
return;
DXP.Utils.ShowInfo(modelTypeMan.ModelDatafileTypeCount().ToString(), "Model data file types");

ModelDatafileTypeFromKind​

This method returns the IModelDatafileType based on the datafile kind. The datafile kinds for:

IModelDatafileType ModelDatafileTypeFromKind(string argKind);
ParameterTypePassing
argKindstringvalue

Returns: IModelDatafileType

Extension method of IModelTypeManagerHelper (using SCH;).

Example: Show the description of the data file type of SI pin model libraries.

using SCH;

IModelTypeManager modelTypeMan = EDP.Utils.LoadModelTypeManager();
if (modelTypeMan == null)
return;
DXP.Utils.ShowMessage(modelTypeMan.ModelDatafileTypeFromKind("SIPinModelLibrary").Description());

ModelTypeAt​

This method returns the indexed model type. First model type starts at 0. This method is used by the ModelTypes property.

IModelType ModelTypeAt(int argnIndex);
ParameterTypePassing
argnIndexintvalue

Returns: IModelType

Extension method of IModelTypeManagerHelper (using SCH;).

This method returns the indexed model type. First model type starts at 0. This property is supported by the ModelTypeAt method.

Example: Show the name of the first model type.

using SCH;

IModelTypeManager modelTypeMan = EDP.Utils.LoadModelTypeManager();
if (modelTypeMan == null)
return;
DXP.Utils.ShowMessage(modelTypeMan.ModelTypeAt(0).Name());

See also: IModelTypeManager.ModelTypeCount, IModelType

Examples: Extension_TestCS

ModelTypeCount​

This method returns the number of models supported by Altium Designer. The available models are PCBLIB, SI, SIM and PCB3DLIB types.

int ModelTypeCount();

Returns: int

Example: Show the names of all model types.

using SCH;

IModelTypeManager modelTypeMan = EDP.Utils.LoadModelTypeManager();
if (modelTypeMan == null)
return;
for (int i = 0; i < modelTypeMan.ModelTypeCount(); i++)
DXP.Utils.ShowMessage(modelTypeMan.ModelTypeAt(i).Name());

ModelTypeFromName​

This method returns the model type interface based on the model type name. The names can be:

IModelType ModelTypeFromName(string argName);
ParameterTypePassing
argNamestringvalue

Returns: IModelType

Extension method of IModelTypeManagerHelper (using SCH;).

PCB3DLIB

PCBLIB

SI

SIM

Example: Show the description of a model type found by its name.

using SCH;

IModelTypeManager aModelTypeManager = EDP.Utils.LoadModelTypeManager();
if (aModelTypeManager == null)
return;
//IModelType aModelType = aModelTypeManager.ModelTypeFromName("PCBLIB");
//IModelType aModelType = aModelTypeManager.ModelTypeFromName("PCB3DLib");
//IModelType aModelType = aModelTypeManager.ModelTypeFromName("SI");
IModelType aModelType = aModelTypeManager.ModelTypeFromName("SIM");
if (aModelType != null)
DXP.Utils.ShowMessage(aModelType.Description());

ModelTypeFromServerName​

This method returns the model type interface based on the server name. The Server names can be:

IModelType ModelTypeFromServerName(string argName);
ParameterTypePassing
argNamestringvalue

Returns: IModelType

Extension method of IModelTypeManagerHelper (using SCH;).

PCB3D

PCB

Sim

SignalIntegrity

Example: Show the description of the model type of the simulation server.

using SCH;

IModelTypeManager modelTypeMan = EDP.Utils.LoadModelTypeManager();
if (modelTypeMan == null)
return;
IModelType modelType = modelTypeMan.ModelTypeFromServerName("SIM");
DXP.Utils.ShowMessage(modelType.Description());

Returned by​

Utils.LoadModelTypeManager

Examples​

Used in the SDK examples: Extension_TestCS.