GIS2BIM.ImportImageInView

Hello everyone,
I’m trying to import an image in View with the node “GIS2BIM.ImportImageInView”.

ImageWidthMeters: 100
View: 3D
ImagePath: A link where the photo is automatically saved (through the node “GIS2BIM.SystemDrawingBitmapToJPG”).
DeltaX: 0
DeltaY: 0

But it doesn’t work.
Could any of the input be incorrect?
I am thankful for your help
ImportImageInView(Test).dyn (92.5 KB)

This could be revit version issue. This part of the api has changed a few times the last couple of years.
Please check for the latest package version.
Hopefully that is enough.

Hello @omar.omar …you could try with archilab instead…

Thanks for the hint. I think I have the latest version.

Thank you for the answer. But the View dont aktzeot the Image.

Hello @omar.omar …are you sure you have yhe right version archilab ??

and when i choose Site Plan i get this Message

hi it seems your try to place the image outside revits limit…try to insert closer to your origin or relocate your projects…

Thank you, is that the right Version what i use? 2022.212.2722?

if you had Revit 2022.212.2722 you should go with the first version in the list

Thank you. its works now
But i have a qutuion. man cann’t import image in 3D View?..

1 Like

Nope it isnt possible even manuelly in revit…

Thank you very much.
I have the coordination as a jgw file. How can I make sure that this photo is placed in the right place and has the right scale?

0.052891
0.000134
0.000134
-0.052891
3500294.958358
5395182.750911

Try with sample custom update for revit 2021,2022


Python Scripts :


#Copyright(c) 2021, Hồ Văn Chương
# @chuongmep, https://chuongmep.com/
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

import System 
from System.Collections.Generic import *

doc = DocumentManager.Instance.CurrentDBDocument

path = IN[0]
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
op = ImageTypeOptions(path,False,ImageTypeSource.Import)
imageType = ImageType.Create(doc,op)
ops = ImagePlacementOptions(XYZ.Zero, BoxPlacement.Center)
img = ImageInstance.Create(doc,doc.ActiveView,imageType.Id , ops)
#Do Action
TransactionManager.Instance.TransactionTaskDone()

OUT = img

If you want try with Csharp Code:

Transaction tran = new Transaction(DB.Doc, "tran");
            tran.Start();
            string path = @"C:\Users\Chuong.Ho\OneDrive\Hình ảnh\python-3521655-2945099.png";
            ImageTypeOptions op = new ImageTypeOptions(path,false,ImageTypeSource.Import);
            ImageType imageType = ImageType.Create(DB.Doc, op);
            if (ImageInstance.IsValidView(DB.Doc.ActiveView))
            {
                ImagePlacementOptions ops = new ImagePlacementOptions(XYZ.Zero, BoxPlacement.Center);
                ImageInstance imageInstance = ImageInstance.Create(DB.Doc, DB.Doc.ActiveView,imageType.Id , ops);
                DB.uiDoc.ShowElements(imageInstance);
            }
            
            tran.Commit();

Some document update you can check
https://www.revitapidocs.com/2020.1/493d203e-ef4c-b447-f979-52b22725b2ad.htm

https://www.revitapidocs.com/2020.1/0f4cd250-7925-6714-3e08-2bd7c0266252.htm
File Demo
ImportImageInView(Test).dyn (71.4 KB)

thank you