Teamcenter is a product lifecycle management software owned by Siemens. ilogic is an automated programming design program in inventor software. How to automatically download the 3D model in teamcenter through the iLogic automation programming program?
In fact, it is very simple, we only need to program with the following code.
- ‘Creates new instance of TCAIAPI.Application
- tcaiAppl = CreateObject(“TCAIAPI.Application”)
- ‘Starts Inventor application, if necessary, and connects to TCAI
- tcaiAppl.StartConnection()
- ‘Gets the TCAIAPI.FileManager object
- tcaiFileManager = tcaiAppl.FileManager
- ‘Defines the filename to be searched
- Dim filenames(3)
- filenames(0) = “D000307115.iam”
- filenames(1) = “30089125.iam”
- filenames(2) = “30089126.iam”
- filenames(3) = “30089229.ipt”
- ‘Search datasets by filename
- datasetUidsByFilenames = tcaiFileManager.FindLatestDatasetsByFilenames(filenames)
- keys = datasetUidsByFilenames.Keys()
- For i = 0 To UBound(keys)
- key = keys(i)
- vals = datasetUidsByFilenames(key)
- For j = 0 To UBound(vals)
- dsInfo = vals(j)
- datasetUid = dsInfo.DatasetUid
- ‘Defines the revision rule to be applied in case of BOM expansion
- options = CreateObject(“Scripting.Dictionary”)
- Call options.Add(“DownloadiMembers”, “1”)
- ‘Gets file in TCAI cache folder
- Call tcaiFileManager.GetFile(datasetUid, options)
- Next
- Next
The meaning of the code in the previous paragraph is to download the drawing number of the 3D model. This requires us to define, we can download in batches, and then set it as an array, so that the models can be downloaded in batches.
The member information in the latter paragraph refers to whether to download the member information of its iPart or assembly.
In this way, when we are doing automation design and programming, we only need to insert the code to download the three-dimensional model we need for assembly or other operations.
Hope our tutorial is helpful to everyone.