0

Python Script list contents of tridb

Branden 2 months ago in Scripting updated by Maxim (Moderator (RUS)) 2 months ago 1

Is there any python script examples available?

I need to loop through the wireframe database and process items.

+1

Hi Branden,

Could you please explain what kind of processing you would like to do with wireframes? Depending on your answer, there can be a different approach.

For example, if you need to get access to the wireframe's meta information rather than its geometry, you can use the standard sqlite3 library. Here is a small example where I get information about name and author of wireframes:

import sqlite3

tridb_path = r'D:\micromine\wf.tridb'

connection = sqlite3.connect(tridb_path)
cursor = connection.cursor()

sql_request = "SELECT Name, CreateBy FROM GeneralInformation"

cursor.execute(sql_request)

print("Name and author: ", cursor.fetchall())

Kind regards,

Maxim