Hi @mohammadkhader698 .
If the document is in the data panel, there is no need to export it.
The documents "A" and "B" are in the same folder, and the following script is executed with "A" open.

# Fusion360API Python script
import traceback
import adsk.fusion
import adsk.core
def run(context):
ui = adsk.core.UserInterface.cast(None)
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
# Search Ducument(DataFile)
targetDocumentName = 'B'
df: adsk.core.DataFile = getDataFileByName(targetDocumentName)
if not df:
return
# Insert DataFile
# https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-D2921ADB-3556-4B9E-98ED-2598EDDB852A
des: adsk.fusion.Design = app.activeProduct
root: adsk.fusion.Component = des.rootComponent
root.occurrences.addByInsert(
df,
adsk.core.Matrix3D.create(),
False
)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def getDataFileByName(
name: str) -> adsk.core.DataFile:
app: adsk.core.Application = adsk.core.Application.get()
dataFolder: adsk.core.DataFolder = app.activeDocument.dataFile.parentFolder
for df in dataFolder.dataFiles.asArray():
if df.name == name:
return df
return None
After execution, "B" will end up being inserted.
