ricaun-io / RevitAddin.DA.Tester

RevitAddin Tester for Design Automation (Forge)
MIT License
0 stars 1 forks source link

Design Automation for Revit ignores `PackageContents.xml` configuration. #7

Open ricaun opened 2 months ago

ricaun commented 2 months ago

By default Design Automation for Revit selects the first ComponentEntry in the PackageContents.xml ignoring the version defined in the RuntimeRequirements.

In the example below, the version 2021 of the .addin is loaded by default even if is selected the engine for Revit 2025.

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="Revit" Name="RevitAddin.DA.Tester" AppVersion="1.3.0" ProductType="Application" ProductCode="7c324916-9f8d-43b0-b226-da67d2504393">
  <Components Description="Revit 2021">
    <RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2021" SeriesMax="R2021" />
    <ComponentEntry AppName="RevitAddin.DA.Tester" ModuleName=".\Contents\RevitAddin.DA.Tester\1.3.0-beta.1\2021\RevitAddin.DA.Tester.addin" />
  </Components>
  <Components Description="Revit 2025">
    <RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2025" SeriesMax="R2025" />
    <ComponentEntry AppName="RevitAddin.DA.Tester" ModuleName=".\Contents\RevitAddin.DA.Tester\1.3.0-beta.1\2025\RevitAddin.DA.Tester.addin" />
  </Components>
</ApplicationPackage>

A reusable solution would be to first search for the right version of the engine in the bundle. And if the version does not exist in the PackageContents.xml, select the first one like in the current version of the DA4R Revit 2025 (RVTDA 04-04-2024).

ricaun commented 2 months ago

Output file for DA4Revit 2025.

{
  "VersionName": "Autodesk Revit 2025",
  "VersionBuild": "25.0.2.419",
  "TimeStart": "2024-04-14T23:32:14.8699528Z",
  "Text": "2025",
  "Reference": "21.0.0.0",
  "FrameworkName": ".NETFramework,Version=v4.8"
}

The DLL loaded is for Revit 2021, as shown in the Reference and FrameworkName.

ricaun commented 1 month ago

Revit engine:

{
    "productVersion": "25.0",
    "deprecationDate": "2028-03-29",
    "description": "Revit 2025 (RVTDA 04-04-2024).",
    "version": 117,
    "id": "Autodesk.Revit+2025"
}

Issues: