How to add Image to Image parameter into Identity Data?

How to add Image to Image parameter into Identity Data?

Anonymous
Not applicable
3,701 Views
5 Replies
Message 1 of 6

How to add Image to Image parameter into Identity Data?

Anonymous
Not applicable

Hi

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

i tried BuiltInParameter class, but didn't work!

 

0 Likes
Accepted solutions (1)
3,702 Views
5 Replies
Replies (5)
Message 2 of 6

aignatovich
Advisor
Advisor

Hi!

 

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

Message 3 of 6

Anonymous
Not applicable

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")

 

0 Likes
Message 4 of 6

aignatovich
Advisor
Advisor
Accepted solution

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

Anonymous
Not applicable

Thanks Smiley Wink

0 Likes
Message 6 of 6

makkiadham
Explorer
Explorer

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?

 

0 Likes