Making a model path relative

Hi guys,

i’m looking for a way to use a relative path to a model in ruby

what i’ve tried is the folowing:

pluginName\Resources\modelname.skp (same as for loading images from a location within plugins folder)

this doesn’t work though,
anny ideas?

path = File.join(__dir__, 'Resources', 'myskp.skp')

or
# add rescue for pre Ruby 2 path = __dir__ rescue File.dirname(__FILE__)
john

2 Likes

great thanks John!

Related Ruby Core documents for future ref:

3 Likes