Retrieve the dwg file from an ImportInstance

Hi,
I’m trying to retrieve the DR01.dwg file (unlinked) from a file.

I managed to find the name and category names of this file.

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
instance=UnwrapElement(IN[0])
doc=instance.Document
scat=instance.Category.SubCategories
lname=[doc.GetElement(c.Id).Name for c in scat]


OUT = instance.IsLinked,instance.LookupParameter("Nom").AsString(),type(doc.GetElement(instance.GetTypeId())),lname

Do we have to do a DWG export of all the objects belonging to these categories? I looked before posting.Perhaps there is an easier approach.

Thank you in advance.

Sincerely,

Christian.stan

An export won’t even get all the data - things are lost once they are brought into Revit.

Best bet will be to identify the original path and see if you can track down that file.

1 Like

Hello and thank you.

In light of your comment and this one on a similar topic,

Similar topic

the only solution is to export the view to DWG with only the isolated instance imported.

Sincerely,

Christian.stan

2 Likes