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: 

Create preview image for a family instance

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
3222 Views, 5 Replies

Create preview image for a family instance

I read this post: http://thebuildingcoder.typepad.com/blog/2010/05/get-type-id-and-preview-image.html 

and can create a preview image of a family instance, however, the image is quite vague no matter how I cange the piexl or QualityLevel value.  Is there any way to create a more clear image using API?  using rendering?

 

Thanks, 

5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: Anonymous

Dear Kukuzry,

 

I guess the built-in family preview image is what it is, so you have to decide whether to take it or leave it.

 

If you would klike a higher quality preview image, you can create it yourself, as discussed here:

 

http://thebuildingcoder.typepad.com/blog/2013/08/setting-a-default-3d-view-orientation.html

 

Here is another discussion about setting the background colour for that very purpose:

 

http://thebuildingcoder.typepad.com/blog/2013/12/setting-the-view-display-background.html

 

There a lots of examples of that on the blog.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
Anonymous
in reply to: Anonymous

I am trying to export a 3d revit model family image for a thumbnail using the revit api. I have tried to turn on the model edges so that they are displayed as darker lines and I have tried to turn on anti-aliasing so that lines are smoothed. I realise it is probably hopeless to switch on the shadows as this option isn't available in a family doc. I have exhausted all the image export options properties. The code below has the export image options and the enumerated revit api properties i have managed to set so far.

    if (view3D != null)
            {                views.Add(view3D.Id);
                var graphicDisplayOptions = view3D.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE);
                // Settings for shaded with edges                graphicDisplayOptions.Set(3);

                var detailLevelOptions = view3D.get_Parameter(BuiltInParameter.VIEW_DETAIL_LEVEL);
                //Settings for view detail, 3 = fine, 2=med, 1=coarse                detailLevelOptions.Set(3);

            }
        }
        catch (Autodesk.Revit.Exceptions.InvalidOperationException)
        {

        }

        var ieo = new ImageExportOptions
        {
            //Export image file configuration settings
            FilePath = ImageFamModelFileName,
            FitDirection = FitDirectionType.Horizontal,
            HLRandWFViewsFileType = ImageFileType.BMP,
            ShadowViewsFileType = ImageFileType.BMP,
            ImageResolution = ImageResolution.DPI_600,
            ShouldCreateWebSite = false
        };
Message 4 of 6
Anonymous
in reply to: Anonymous

I don't know which revit version you are on, but setting the 'thin lines'option before making a preview sometimes helps getting a clearer preview.

Message 5 of 6
Anonymous
in reply to: Anonymous

Thanx for your assistance Remy, I am creating thr images with the revit 2015 api. The problem is that I can't get any lines as the lines are switched off by default when creating an image export as far as I know from the code I have created this used to be any easy property to turn on and is now deprecated to my frustration albeit it is likely a postiive change i don't understand.
Message 6 of 6
Revitalizer
in reply to: Anonymous

Hi spammasterblaster (nice name),

 

there is no thin lines access in Revit 2015.

There may be a workaround using UIAutomation:

http://thebuildingcoder.typepad.com/blog/2015/03/thin-lines-add-in-using-ui-automation.html

 

 

Regards,

Revitalizer

 




Rudolf Honke
Software Developer
Mensch und Maschine





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

Post to forums  

Rail Community


Autodesk Design & Make Report