Easy way to avoid hardcoded paths for Uri

Hi everyone, I want to import some custom components into my layout.

uriBlockGeo = “file:///”+r"C:\Users\Public\Documents\Visual Components\4.5\Models\Components\Visual Components\Basic Shapes\BlockGeo.vcmx"
component = _app.load(uriBlockGeo )

Is there an alternative so I don’t have to use the actual path to my component?

You can use the component’s VCID instead

uriBlockGeo = “vcid:d788ff8d-649f-4794-b9ea-5018d931db72"
component = _app.load(uriBlockGeo )
1 Like

Hy,

over .Net-Api there are more possibilities for things like this. There are some functionalities from eCat which make it possible to look for components by name and get the URL over this…

Regards
Feature

1 Like

@ccamilo Thank you very much! This is quite helpful!
@captain_feature thanks! I’ll have a look at the .net API too!