I’m using “Sketchup.active_model.definitions.import” to impot a collada file(.dae). This worked without any problem for both Mac and Windows in Sketchup 2021. Now that I have upgraded to Sketchup 2023 I get this error on Mac:
Error: #<IOError: Failed converting file to SKP>
Does anyone know what has changed from 2021 to 2023 that might have caused this for Mac?
The(IOError) is raised if the file is missing.
Without seeing the full code I guess something wrong with the path(String) parameter when you are calling the DefinitionList #import method…
Perhaps you don’t have rights to read that file/directory… maybe the Sketchup does not installed properly
(or you are started Sketchup from the .dmg << I’m not a “Mac man”, just read somewhere that may causing this kind of things… )
I use Sketchup.temp_dir to copy the file from a server to the local temp folder, so it should probably have raised a error in that step if it didn’t exist but I will look into it, thanks
I tried it with a simple file from the 3D warehouse. It did work, both on Windows and Mac.
Can you see if the file appears to be a valid xml file? Have you tried validating it (macOS only)? The below terminal command should validate it. I think it’s normally installed on macOS, not sure…
Supposedly, the API definition import method just calls the C++ native importer that the manual command uses.
Try downloading it to a different folder. Make sure you have folder permissions and use a test loop to test that the file is accessible. Ie, use File.exist? and File.readable? before calling the import method.