revit无法加载图像路径
我试图将临时的内在图形图形放在这样的修订中:
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;
}
}
但是我“无法从指定的路径加载图像”。错误信息。我尝试了各种不同的路径,错误停留。
Revit 2023 API是否有问题?我可以尝试显示我的图像?
感谢您的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们发现.bmp图像必须具有(0,128,128)的背景颜色值。我们的2022年修订图像有所不同。一旦我们更改了颜色值,图像就会成功加载。
We found out that .bmp images must have a Background color value of (0,128,128). Our images for Revit 2022 were somehow different. Once we changed the Color value, the images loaded successfully.
您是否试图使用管理权进行修订?默认情况下,修订的过程可能没有必要的权限。
也许在调用incanvascontroldata之前这样确保您可以打开文件?
Have you tried to run Revit with admin rights? The process that Revit runs on might not have necessary permissions by default.
Maybe something like this before you call InCanvasControlData to make sure you can open the file?