Exported image line weight (thin line) and rendering setting

Anonymous

Exported image line weight (thin line) and rendering setting

Anonymous
Not applicable

I use this code http://thebuildingcoder.typepad.com/blog/2013/08/setting-a-default-3d-view-orientation.html  to export the image.

 

In Revit, I can manually change model to thin lin by clicking the "thin line" icon in the quick qccess menu. However, when I export images using Wireframe, the line is still thick.  My question is that how I can export image with thin lines (without manually revising each line weight for each category/element)?

 

=============================

 

My second question is that how I can export rendered image?  I search online but did not find anything.

 

In the code below, an integer is used to control the visual style (e.g., wireframe, shade, realistic etc). for example, in this code, it uses the number 6 to set visual style to "shade".   In Revit, I see an option called "Ray trace", which integer should I choose to set it to that option?  

 

ar graphicDisplayOptions
        = view3D.get_Parameter(
          BuiltInParameter.MODEL_GRAPHICS_STYLE );
 
      // Settings for best quality
 
      graphicDisplayOptions.Set( 6 );  // visual stype: 6 = shade

 

Thanks,.  

0 Likes
Reply
6,525 Views
4 Replies
Replies (4)

jeremytammik
Autodesk
Autodesk

Dear Kukuzry,

 

I searched around quite a bit to find an answer to your thin lines question.

 

For one, I found that we have a lontg-standing wish list item CF-192 [As an add-in developer, I need the API ability to detect and modify the "Thin lines" setting, so that the user can automatically get the environment configured in the way they like.] that does not seem to have been addressed yet. I added a note of your request to that to make the development team aware of its importance.

 

Secondly, you can obviously use the Windows API to toggle the thin lines setting, e.g. something like 

 

  System.Windows.Forms.SendKeys.SendWait( "TL" ); // use the TL shortcut

 

The problem with this is that there is no way to find out programmatically what the previous setting was, so you don't know whether you are switching it on or off.

 

Third, I found an interesting entry in the What's New in Revit 2015 R2 document:

 

http://help.autodesk.com/view/RVT/2015/ENU/?guid=GUID-6084E92F-4C46-4047-B98C-2984E730A53D

 

New in Revit 2015 R2

 

Thin lines: To improve consistency between Revit sessions, when you use the Thin Lines tool, the setting is stored in the Revit.ini file. When you launch Revit, the stored Thin Lines setting is used as the default. See Graphics Settings in Revit.ini.

 

http://help.autodesk.com/view/RVT/2015/ENU/?guid=GUID-9D26B850-026A-4734-BB76-997154ADE5F2

 

Graphics Settings in Revit.ini

 

ThinLinesEnabled

 

Stores the Thin Lines setting.

 

  • Type = integer
  • Valid values: 1 = enable thin lines (default), 0 = disable thin lines

 

Note: This feature or functionality is available only to students and to Autodesk Maintenance and Desktop Subscription customers for Revit 2015 software releases.

 

I hope this helps.

 

Please let us know how you end up making use of this.

 

Thank you!

 

Cheers, 

 

Jeremy



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

0 Likes

jeremytammik
Autodesk
Autodesk

I just heard back from the development team on this issue, and they add that the thin lines setting provided in the INI file from Revit 2015 R2 onwards is also programmatically accessible:

 

Thin lines options

 

A utility class ThinLinesOptions is added that contains the setting related to the Thin Lines options which affects the display in the UI. 

 

The static property:

 

  • ThinLinesOptions.AreThinLinesEnabled

 

defines if the 'Thin Lines' setting is on or off in this session.

 

I think we can therefore consider this issue finally resolved, and the wish list item has consequently been closed.

 

Cheers,

 

Jeremy



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

0 Likes

Anonymous
Not applicable

Hi Jeremy,  thank you for your detailed reply.  

 

 

(1)I mannually export the image, see the setting of the display option, and also click the thin-line icon on top of menu. However, I still cannot export thin line. 

 

(2) I do not have 2015 version, I am using 2014 Revit.  Is that possible to manually make some settings, and then run the add-on to automate the image exporting only, that is to say, I manually set  to thin line in Revit, and users will not make any change of the settings. Then If the user runs the plugin, is that possible to export an image with thin line?  I tried but does not work, which setting should I use?

 

111.jpg

 

Thank you,  

0 Likes

jeremytammik
Autodesk
Autodesk

A solution providing programmatic control over the Thin Lines setting is presented by Revitalizer and The Building Coder here:

 

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



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

0 Likes