Failed to Load ImagePath

Failed to Load ImagePath

florian.schaeferTJTBZ
Participant Participant
593 Views
4 Replies
Message 1 of 5

Failed to Load ImagePath

florian.schaeferTJTBZ
Participant
Participant

Hello, 

i try to Place a Temporary In-Canvas Graphic in Revit like this:

var activeUiDoc = document.Application.ActiveUIDocument;
        var activeDbDoc = activeUiDoc.Document;



        using (var graphicsManager = TemporaryGraphicsManager.GetTemporaryGraphicsManager(activeDbDoc))
        {

            try
            {
                var insertionPoint = activeUiDoc.Selection.PickPoint("Select insertion Point");
                var logoData = new InCanvasControlData(@"C:\Program Files\Autodesk\Revit 2023\uniE1D2.bmp", XYZ.Zero);

                var index = graphicsManager.AddControl(logoData, ElementId.InvalidElementId);
            } catch(Exception ex) 
            {
                return;
            }
        }

 

But i get a "Failed to load the image from specified path." Error message. I have tried various different Paths, the Error stays.

Is there an Issue with the Revit 2023 Api? What can i try to get my image displayed.
Thanks for the help.

0 Likes
Accepted solutions (1)
594 Views
4 Replies
Replies (4)
Message 2 of 5

ricaun
Advisor
Advisor

Looks like is working fine on Revit 2023.

 

Here is a simple example:

See yaa

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 3 of 5

florian.schaeferTJTBZ
Participant
Participant

Are you sure you are using Revit2023.exe when i start your project it asks for Revit2022.exe?

0 Likes
Message 4 of 5

ricaun
Advisor
Advisor
Accepted solution

The default version is 2022 but I tested on Revit 2023.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 5 of 5

florian.schaeferTJTBZ
Participant
Participant

Thanks a lot for all your Effort and Help.
The Issue was that something changed from 2022-2023 because the .bmp file we used in 2022 had different colored backgrounds. After i changed the Backgrounds to your image background, everything worked.

Thanks again.

0 Likes