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.
sovitek
November 12, 2021, 10:24am
3
Hello @omar.omar …you could try with archilab instead…
Hello all,
I am trying to figure out a way to have a dynamo graph read the parameter for a family Type image to then load the image and have it placed in a specific spot on a sheet. I know how to read the parameter, but can’t figure out a way to have it then loaded and placed on a sheet. Any ideas?
Thanks for the hint. I think I have the latest version.
Thank you for the answer. But the View dont aktzeot the Image.
sovitek
November 15, 2021, 8:22am
6
Hello @omar.omar …are you sure you have yhe right version archilab ??
@Konrad_K_Sobon
I have a quick question regarding the multiple versions of Archilab you currently offer and how they may (or may not?) function within a graph that is used between different versions of Revit.
Basically I have graphs that are used for all of our current Revit versions in house. If I utilized nodes from your package that is for Revit 20, will it still work in Revit 21 and 22 assuming I have the correct packages installed for each version?
The main reason I ask is that I was ju…
and when i choose Site Plan i get this Message
sovitek
November 15, 2021, 8:28am
8
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?
sovitek
November 15, 2021, 8:39am
10
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
sovitek
November 15, 2021, 8:54am
13
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)