05/27/2012

Batch appending files to nwf and save to nwd by VBScript

IssueIs there a way through VBScript to publish a directory of dwg's to an single .nwd file?

Solution Navisworks can append the same file more than once without warning. You need to use code to check if the file has been existed. roamer.state.CurrentPartition (InwOaPartition) returns the top level access to the current model. if any files are appended, InwOaPartition.Children will tell each file. So you can use InwOaPartition.FileName to check if the file existed or not. The attached VBS checks if C:\temp\1.dwg1 has been appended to the main nwf.

Comments

IssueIs there a way through VBScript to publish a directory of dwg's to an single .nwd file?

Solution Navisworks can append the same file more than once without warning. You need to use code to check if the file has been existed. roamer.state.CurrentPartition (InwOaPartition) returns the top level access to the current model. if any files are appended, InwOaPartition.Children will tell each file. So you can use InwOaPartition.FileName to check if the file existed or not. The attached VBS checks if C:\temp\1.dwg1 has been appended to the main nwf.