-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreport_cad_imports.py
More file actions
25 lines (23 loc) · 902 Bytes
/
report_cad_imports.py
File metadata and controls
25 lines (23 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def GetImportedCADs(document):
return list(document.GetElements[ImportInstance]().Where(lambda i: not i.IsLinked))
# NOTE: links must be loaded if they are to be included in the report!
def ReportImportedCADs(document):
docs = list()
docs.append(document)
for link in document.GetLinkedDocuments():
docs.append(link)
for d in docs:
print "-" * 75
print "Document: '" + d.Title + "'"
print
#print "CAD Imports:"
cads = list(GetImportedCADs(d))
print len(cads).ToString() + " Imported CAD Files\n"
if len(cads) > 0:
for cad in cads:
view = d.GetElement(cad.OwnerViewId)
print cad.Id.ToString().rjust(10) + " '" + cad.get_Parameter(BuiltInParameter.IMPORT_SYMBOL_NAME).AsString() + "'", ("'" + view.Name + "'") if view is not None else "<NO VIEW>"
else:
print " [NO CAD IMPORTS]"
print "-" * 75
ReportImportedCADs(doc)