Definitions.load_from_url failing when called from an HTMLDi
-
Hello,
I am trying to load a ComponentDefinition from a local file in my PC (shipped with the extension, actually), but it just freezes when done from an HTMLDialog callback.
The original call is made from HERE, and it freezes when gets to THIS point.
However, when I call the GH::Groundhog::Photosensor.add(arguments) function from the Ruby console, it works beautifully.
Any idea why this might be happening? I could not find any other information online
THANKS TO ALL IN ADVANCE!
EDIT::: This is happening in Sketchup Make 2017, in macOS High Sierra.
-
But
...load_from_urlonly works with proper URL HTTP address paths etc.
And, since you are already shipping the SKP within a subfolder with your extension, then you can simply use:
defn = Sketchup.active_model.definitions.load('full_path_to_subfolder/MODEL.skp')
You can easily get the path to your subfolder from__FILE__as your file loads...
perhaps testing with:
unless model.definitions['MODEL'], to avoid reloading it ?? -
It worked wonderfully! I was using the load_from_url method with a file:// prefix before, and it also worked... but this makes more sense.
Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement