The Sketchup::DefinitionList class has no #import_from_url method compliment to the #load_from_url method, so that coders can download and import non-SKP files from a network or a remote web server using a LoadHandler interface.
Attempting to use #import to import from a network raises an #<IOError: Failed converting file to SKP> exception.
The current workaround is to use the Sketchup::Http::Request to download the file to a local disk location and then do the local import using Sketchup::DefinitionList#import(). After a successful import, code should probably delete the temporary downloaded file using File::delete.
SketchUp Ruby API Feature Request
The
Sketchup::DefinitionList
class has no#import_from_url
method compliment to the#load_from_url
method, so that coders can download and import non-SKP files from a network or a remote web server using aLoadHandler
interface.Attempting to use
#import
to import from a network raises an#<IOError: Failed converting file to SKP>
exception.REF: https://forums.sketchup.com/t/using-definition-import-to-import-dae-files-only-works-locally/230861
The current workaround is to use the
Sketchup::Http::Request
to download the file to a local disk location and then do the local import usingSketchup::DefinitionList#import()
. After a successful import, code should probably delete the temporary downloaded file usingFile::delete
.