Hi, the Import phase in Vred is via parallel thread. i don't remember if the new api i wrote (vrFileIO.Load) is synchronous or not. You have to try.
For the imported data to manage with a new Vred is easier. The new parameter that @__daniel.lincoln__ put (the parent node) is useful to manage that.just create a new node an import your data inside it.
Also the vrFileIO.load(filename, filenames, parent, newFile, showImportOptions) has the Parent parameter in the 2023. You could check in the 2022 api help.
Then manage all that is inside that node
Or you can try to manage the references. While importing the Wire file it should maintain the reference with the original file. So once imported, scan the the tree to find the node with the reference to that file.
And then work on that tree.
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtWidgets import QFileDialog
selectedFile = QFileDialog.getOpenFileName(None, "Select File", "C:\\", "*.iam")
print(selectedFile[0])
# vrGUIService.openImportDialog([selectedFile[0]])
importedParent = findNode("Imported Data")
imported = vrFileIO.load([selectedFile[0]], importedParent, False, False)
print(imported)
print(importedParent.getNChildren())
With the showImportOptions False the execution is synchronous. if you have to put it to True, just add a Loop to wait until the importParent node has some child. it should work.
I don't think it will be too difficult. just take some time to read the Api docs.
Best
Chris