DWG Links File Sizes

revit
dynamo

#1

i have a script that can list the number of dwg links and imports in a project, but i was wondering if there was a way to get the file sizes of those links reported through dynamo?


#2

This might help you: Getting Family size from revit


#3

Hi @Kirsty_Hogg use custom node “Springs.FileSize” from @Dimitar_Venkov springs package.


#4

what if i want to pull the sizes directly from the project model rather than a directory location on the network?


#5

ReportCADLinks is coming soon to v2.0 of BimorphNodes package due for release this month; I’ll see if its possible to add this info as part of the report output beforehand.


#6

@Kirsty_Hogg Yes it is possible to pull sizes directly from model. There is a method called “ExternalFileUtils” in Revit API to get elements which are external file references http://www.revitapidocs.com/2015/e991de74-3837-b9de-310d-06ea183c1bac.htm

And here is the dyn file ForKristy.dyn (4.9 KB)


#7

Hi @Thomas_Mahon

That would be great!

Just a thought here. It would be better if you can just keep “refresh” as input and remove “filePath” to avoid any confusions for the users. Cheers!


#8

oh cool, that would be great thanks!


#9

oh great, thank you for that @Kulkul, that’s awesome! I shall try it out this morning :slight_smile:


#10

@Kulkul possibly, I’m open to improvement suggestions. Here’s the purpose of the filePath input:

So the moment the node is placed on the graph it will report the current document without the user needing to do anything. If they want to audit any file, either another RVT or a Family file, thats not their current document (i.e. an external file) they can input a file path to report on that file. The first version had just the refresh input as you suggest, however tt was a response to this thread that gave rise to the filePath input.

What do you think?


#11

@Thomas_Mahon In that case keep I would say all 3 (FilePath,CurrentDoc,Refresh) inputs will be good enough. Users will have a choice if they want to use it in “CurrentDoc” or “External Document”.


#12

@Kulkul I’ve just looked at implementing this but there’s a snag: all the inputs would need satisfying for the node to run, for example, if one wants to report the current document, they would also need to input …a redundant file path.

Default inputs therefore work, but this is self defeating since the default input to document would be the current document! Which means I go full-circle and realise that the refresh and filePath inputs are the minimum required. An alternative could be two nodes for each scenario, but that would create an obfuscation/profligacy. I could rename the input, but I’m following the naming conventions outlined here as much as possible and using the input hints to provide the detail.


#13

@Thomas_Mahon Sounds Good :slight_smile: :+1:


#14

If anyone is interested in the script below is the working dynamo script for getting all the file names for the linked dwg files, their individual sizes, converting them to MB and exporting that to an excel table. Thanks everyone for their help and input.



#15

This script will work for Linked CAD files, Is there a way to query import CAD instance file sizes?


#16

Hi sorry for the late reply, i do have a script that reports links and imports. i can’t remember if it also extracts the file size information but it should be easy enough to adapt if it doesn’t.links and imports.dyn (17.2 KB)