SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
39 stars 10 forks source link

REQ: `Sketchup::DefinitionList#import_from_url` #900

Open DanRathbun opened 1 year ago

DanRathbun commented 1 year ago

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 a LoadHandler 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 using Sketchup::DefinitionList#import(). After a successful import, code should probably delete the temporary downloaded file using File::delete.

thomthom commented 1 year ago

I think what you describe as a workaround is a reasonable workflow.

DanRathbun commented 1 year ago

Yes, of course but it is much more complex for newbs especially if they have no web interaction experience.