Return a list of imported Images with their resolution

Return a list of imported Images with their resolution

Anonymous
Not applicable
543 Views
1 Reply
Message 1 of 2

Return a list of imported Images with their resolution

Anonymous
Not applicable

I am trying to create an auditing check that will return a list of images imported into the file and also their resolutions, but I am stuck at returning the image's resolution, this is what I have so far:

 

		public void findImports()
        {
            Document doc = this.ActiveUIDocument.Document;
            string info = "";
           
            FilteredElementCollector Col = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RasterImages);
     		
            BuiltInParameter pixelH = BuiltInParameter.RASTER_SYMBOL_PIXELHEIGHT;
            
            foreach (Element e in Col)
            {         	
            	
                Parameter p = e.get_Parameter(pixelH);
            	          	
            	info += e.Name + " - " + p.ToString() + " - " + e.Id + Environment.NewLine;
            	
            }
            TaskDialog.Show("elements",info);
        }

 

 

I am not sure if I am on the right path or not, but this will not currently run.  Is anyone able to help me at all?  Thanks!

0 Likes
544 Views
1 Reply
Reply (1)
Message 2 of 2

Revitalizer
Advisor
Advisor

Dear tjhogan2,

 

your code gets both image Elements and ImageTypes.

But only the ImageTypes provide your BuiltInParameters.

 

Their StorageType is Integer, so you could write p.AsInteger().ToString() or p.AsValueString().

 

 

Best regards,

Revitalizer

 




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes