Message 1 of 2
Revit 2020 ImageInstance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I am having a problem with the new ImageInstance in Revit 2020.
For most users my code (shown below) works fine and the image is inserted at the right size in the right location however one of my users experiences an error even when loading exactly the same image as everyone else.
Any advise on how to fix this?...
"PicturePath" is a string, full file path of the .JPG image
TheSheet is a ViewSheet
try
{
ImageTypeOptions imagetypeoptions = new ImageTypeOptions("PicturePath");
ImageType imagetype = ImageType.Create(doc, imagetypeoptions);
ImageInstance ii = ImageInstance.Create(doc, TheSheet, imagetype.Id, new ImagePlacementOptions());
ii.Height = 0.3;
ii.SetLocation(new XYZ(0.10, 0.008, 0), BoxPlacement.BottomRight);
}
catch (Exception e)
{
TaskDialog.Show("Image Error", e.Message);
}