Using “definition.import” work when importing local .dae files from "C:". But when I try to use the same code to import the same files on a network space it throws this error:
#<IOError: Failed converting file to SKP>
Has anyone else had this problem before?
I can import .skp file from the same space with “model.definitions.load” so it’s not an access problem.
In many case over the years, we’ve found that the SketchUp API to be susceptible to network latency issues.
If loading a .skp file from a network path, code should use Sketchup::DefinitionList#load_from_url() with a LoadHandler object (as shown in the documentation for this method.)
For import of non-SKP files, it would likely be best to use the Sketchup::Http::Request to download the file to a local disk location (Downloads folder or wherever, see Sketchup::temp_dir,) … and then do the local import using Sketchup::DefinitionList#import().
After a successful import, code should probably delete the temporary downloaded file. See File::delete in the Ruby core documentation.