How to use an environment variable in the SmartComponent XML?

Options
Hi,

We are building and sharing SmartComponents, but they currently have paths in the XML files which are user local. We want to replace them by "%LocalAppData%\ABB\DistributionPackages" but, when compiling, it seems to convert these paths into "C:\Program Files (x86)\ABB\RobotStudio 2022\ABB Library\Components\%LocalAppData%\ABB\DistributionPackages".

Is there any way for it to properly use the existing environment variables when expanding these paths?

Thanks and best regards,
Hugo Costelha

Comments

  • Hello there,

    Which XML-files are you referring to?

    Maxim Riabichev
    PC Software Support Engineer
  • hcostelha
    Options
    Hi,

    I am referring to the XML file used for configuring a Smart Components when we are building one using the RobotStudio SDK.

    Best regards,
    Hugo Costelha
  • Can you show an example of what you wish to achieve, in the XML?

    Maxim Riabichev
    PC Software Support Engineer
  • hcostelha
    Options
    Hi Maxim,

    For instance, we have some SmartComponents built by use that use RoboStudio provided components, which, ini that case, we use somethin like this:
    [...]
    <GraphicComponents>
        <EmbeddedLibrary source="%ABBLIBRARY%\Components\VolumeSensor.rslib" name="in_place">
    [...]
    In this case, the "%ABBLIBRARY%"
    However, we have some SmartComponents built by us that also use other components built by us. In these case, the XML is usually something like this:
    [...]
    <GraphicComponents>
        <EmbeddedLibrary source="C:\Users\marce\Documents\RobotStudio\Libraries\MecanismoVisao.rslib" name="MecanismoPeca" />
    [...]
    In these cases, we want to use something like this:
    <GraphicComponents>
        <EmbeddedLibrary source="%LocalAppData%\ABB\DistributionPackages\SistemaVisao.rslib" name="SistemaVisao">
    However, when loading the SmartComponent, it expands to something like this:
    C:\Program Files (x86)\ABB\RobotStudio 2022\ABB Library\Components\%LocalAppData%\ABB\DistributionPackages\SistemaVisao.rslib
    Thanks in advance for your help.

    Regards,
    Hugo
  • I checked with R&D and it turns out that LibraryCompiler doesn't support environment variables.

    Maybe it could be possible to edit the PIM.xml post-compilation, in the rslib package?

    Maxim Riabichev
    PC Software Support Engineer
  • hcostelha
    hcostelha
    edited February 2023
    Options
    I checked with R&D and it turns out that LibraryCompiler doesn't support environment variables.

    Maybe it could be possible to edit the PIM.xml post-compilation, in the rslib package?
    Hi Maxim,

    We have tried that, but it does not work, it also is unable to process environment variables. Of course we can change it to the full path of the current user, but we were looking for a more streamlined process.
    So, is there any way how we can refer to modules which are not in the RobotStudio installation, but on a users' folder, such as "%LocalAppData%\ABB\DistributionPackages\SistemaVisao.rslib"?

    Thanks and regards,
    Hugo Costelha 
  • Not at this time.

    I'll ask around to see what would be the best way forward.

    Maxim Riabichev
    PC Software Support Engineer