Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add Image to Image parameter into Identity Data?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
yousefg
2527 Views, 5 Replies

How to add Image to Image parameter into Identity Data?

Hi

How could i add Image to Image Instance Parameter into Identity Data? 

i tried BuiltInParameter class, but didn't work!

 

Tags (3)
5 REPLIES 5
Message 2 of 6
aignatovich
in reply to: yousefg

Hi!

 

Find ImageType element (or create a new one), provide its id to parameter.Set method

Message 3 of 6
yousefg
in reply to: aignatovich

thanks, but as i know its not possible to create project parameter https://forums.autodesk.com/t5/revit-api-forum/create-project-parameter-not-shared-parameter/td-p/51...

 

if i use this code for getting parameter

Parameter param = ele.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_IMAGE);

is it ok to define the url of image by string?

param.Set(@"C:\Users\Desktop\12.jpg")

 

Message 4 of 6
aignatovich
in reply to: yousefg

You are right, you should get your parameter by BuiltInParameter.ALL_MODEL_TYPE_IMAGE, that is correct (from your code).

 

But the next part won't work. You should do something like:

var imageType = ImageType.Create(doc, pathToImage);

parameter.Set(imageType.Id); 
Message 5 of 6
yousefg
in reply to: aignatovich

Thanks Smiley Wink

Message 6 of 6
makkiadham
in reply to: yousefg

Hello,

I created and instance parameter of type image. I was able to insert an image into the parameter for every instance with the below code.

 

var imageType = ImageType.Create(activeDoc, lo.barcode_image);
rw_barcode_image.Set(imageType.Id);

 

now I need to iterate through the element instances and get the image path from each parameter. I just need the code to fetch the image path from the parameter. could someone please help me?

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community