GetPreviewImage returns null in Rebar-Shape

GetPreviewImage returns null in Rebar-Shape

Arciviz
Advocate Advocate
863 Views
2 Replies
Message 1 of 3

GetPreviewImage returns null in Rebar-Shape

Arciviz
Advocate
Advocate
FilteredElementCollector RBShpColl = new FilteredElementCollector(doc).OfClass(typeof(RebarShape));
         
Bitmap Stirrups_bitmaps; foreach(RebarShape shape in RBShpColl) { if(shape.RebarStyle == RebarStyle.StirrupTie) { Stirrups_bitmaps = new Bitmap( shape.GetPreviewImage(new Size(100 , 100))); } }
0 Likes
Accepted solutions (1)
864 Views
2 Replies
Replies (2)
Message 2 of 3

Mustafa.Salaheldin
Collaborator
Collaborator
Accepted solution

Select the Rebar and look at the "Properties" pane, if there is no image then you will get a null value when you are using the GetPreviewImage method.

 

rebarImage.PNG

 

If this reply satisfies your need please don't forget to mark it as an answer.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

Message 3 of 3

Arciviz
Advocate
Advocate

How revit shows images in "rebar shape browser".