How to automatically download 3D models in teamcenter through the iLogic automation programming program

Teamcenter is a product lifecycle management software owned by Siemens. iLogic is an automated programming design program in the inventor software. How to automatically download 3D models in Teamcenter through the iLogic automation programming program?
In fact, it is very simple, we only need to use the following code to program.

' 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) = "xxxx.iam"
filenames(1) = "xxxx.iam"
filenames(2) = "xxxx.iam"
filenames(3) = "xxxx.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 to 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 automatic design and programming, we only need to insert the code to download the 3D model we need for assembly or other operations.
Hope our tutorial is helpful to you.

Leave a Reply