DWG Links File Sizes

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?

This might help you: Getting Family size from revit

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

1 Like

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

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.

2 Likes

@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 ExternalFileUtils Methods

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

3 Likes

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!

oh cool, that would be great thanks!

1 Like

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

@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?

@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”.

2 Likes

@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.

@Thomas_Mahon Sounds Good :slight_smile: :+1:

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.


1 Like

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

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)

Hi @Kirsty_Hogg and @Kulkul, I know this was posted a long time ago, but I am trying to do something similar, and my springs.filesize node returns a null value, Am I missing something?

Never mind. I’m blind. The issue was I’m testing it on a copy of a file, so the paths are broken, so it cant read them this way, unless I’m mistaken.

Ok, Tried again on a live file, and the error seems to be that springs.filesize is returning a null value. Everything up til that node returns the expected data if hooked to a watch node.


Does anyone have any ideas? Does this node just not work anymore?

Edit: I assume this is why my transpose isn’t working in the other group