Skip to content

Commit

Permalink
SketchUp 2024.0. (24.0.484, 24.0.483)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Apr 4, 2024
1 parent 6bed77d commit 3258158
Show file tree
Hide file tree
Showing 16 changed files with 2,688 additions and 2,404 deletions.
22 changes: 20 additions & 2 deletions Layout/Document.html
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,15 @@ <h3 class="signature " id="export-instance_method">
<span class='label'>compress_images:</span> <span class='const'>TRUE</span><span class='comma'>,</span>
<span class='label'>compress_quality:</span> <span class='float'>0.75</span> <span class='rbrace'>}</span>

<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>c:/my_export.pdf</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>

<span class='comment'># Export pages one and three through five. Note that page_range starts at
</span><span class='comment'># index 1.
</span><span class='comment'># `page_range` support added in LayOut 2024.0.
</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>page_range:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1,3-5</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
<span class='label'>compress_images:</span> <span class='const'>TRUE</span><span class='comma'>,</span>
<span class='label'>compress_quality:</span> <span class='float'>0.75</span> <span class='rbrace'>}</span>

<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>c:/my_export.pdf</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span></code></pre>


Expand All @@ -1693,13 +1702,22 @@ <h3 class="signature " id="export-instance_method">
<pre class="example code"><code><span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Layout.html" title="Layout (module)">Layout</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Layout::Document (class)">Document</a></span></span><span class='period'>.</span><span class='id identifier rubyid_open'><span class='object_link'><a href="#open-class_method" title="Layout::Document.open (method)">open</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>c:/path/to/document.layout</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>

<span class='comment'># Export png files on macOS, with default settings.
</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/Users/username/Desktop/pngs/page.png</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/Users/&lt;username&gt;/Desktop/pngs/page.png</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>

<span class='comment'># Export pages one through three at 300 dpi as JPGs.
</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>start_page:</span> <span class='int'>1</span><span class='comma'>,</span>
<span class='label'>end_page:</span> <span class='int'>3</span><span class='comma'>,</span>
<span class='label'>dpi:</span> <span class='int'>300</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>c:/page.jpg</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span></code></pre>
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>c:/page.jpg</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>

<span class='comment'># Export pages one and three through five. Note that page_range starts at
</span><span class='comment'># index 1.
</span><span class='comment'># `page_range` support added in LayOut 2024.0.
</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>page_range:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1,3-5</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
<span class='label'>compress_images:</span> <span class='const'>TRUE</span><span class='comma'>,</span>
<span class='label'>compress_quality:</span> <span class='float'>0.75</span> <span class='rbrace'>}</span>

<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_export'>export</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>c:/my_export.png</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span></code></pre>

</div>

Expand Down
16 changes: 16 additions & 0 deletions Layout/Entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,22 @@ <h3 class="signature " id="move_to_layer-instance_method">

</li>

</ul>
<p class="tag_title">Known Bugs:</p>
<ul class="bug">

<li>





<div class='inline'>
<p>In LayOut versions prior to LayOut 2024.0 this method would fail to move entities from non-shared layers.</p>
</div>

</li>

</ul>

</div>
Expand Down
52 changes: 49 additions & 3 deletions Sketchup.html
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ <h2>


<span class="summary_desc"><div class='inline'>
<p>The size_viewport method changes the pixel size of the viewport and SketchUp window.</p>
<p>The <span class='object_link'><a href="#resize_viewport-class_method" title="Sketchup.resize_viewport (method)">Sketchup.resize_viewport</a></span> method changes the pixel size of the viewport and SketchUp window.</p>
</div></span>

</li>
Expand Down Expand Up @@ -4717,6 +4717,19 @@ <h3 class="signature " id="open_file-class_method">

</li>

<li>

<span class='name'>with_status</span>


<span class='type'>(<tt>Boolean</tt>)</span>


<em class="default">(defaults to: <tt>true</tt>)</em>


</li>

</ul>

<p class="tag_title">Returns:</p>
Expand All @@ -4731,7 +4744,7 @@ <h3 class="signature " id="open_file-class_method">

&mdash;
<div class='inline'>
<p>status code if opening the file succeeded, <code>false</code> otherwise.</p>
<p>status code if opening with <code>with_status</code> set to <code>true</code>, otherwise <code>true</code> or <code>false</code>.</p>
</div>

</li>
Expand Down Expand Up @@ -5885,7 +5898,24 @@ <h3 class="signature " id="resize_viewport-class_method">
</h3><div class="docstring">
<div class="discussion">

<p>The size_viewport method changes the pixel size of the viewport and SketchUp window. This can be useful for producing a consistent behavior in automatic testing, regardless of the display resolution.</p>
<div class="note notetag">
<strong>Note:</strong>
<div class='inline'>
<p>In SketchUp 2024.0 and later this method doesn&#39;t behave correctly in all cases on Windows. The passed values are internally converted to logical pixels, rounded and converted back to physical pixels. This means certain sizes, such as 1000 px at 150% scaling, cannot be accurately set.</p>

<p>As a workaround in you can use sizes that are evenly divisible with common scale factors, if you depend on pixel perfect sizes.</p>

<pre class="code"><code class=""><span class='comment'># Changes by 1 px :(
</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>1000</span><span class='op'>/</span><span class='float'>1.5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='op'>*</span> <span class='float'>1.5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='comment'># =&gt; 1001
</span><span class='comment'># Survives the round-trip :)
</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>1500</span><span class='op'>/</span><span class='float'>1.5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='op'>*</span> <span class='float'>1.5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='comment'># =&gt; 1500
</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>1500</span><span class='op'>/</span><span class='float'>1.25</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='op'>*</span> <span class='float'>1.25</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='comment'># =&gt; 1500
</span></code></pre>
</div>
</div>


<p>The <span class='object_link'><a href="#resize_viewport-class_method" title="Sketchup.resize_viewport (method)">resize_viewport</a></span> method changes the pixel size of the viewport and SketchUp window. This can be useful for producing a consistent behavior in automatic testing, regardless of the display resolution.</p>


</div>
Expand Down Expand Up @@ -5990,6 +6020,22 @@ <h3 class="signature " id="resize_viewport-class_method">

</li>

</ul>
<p class="tag_title">Known Bugs:</p>
<ul class="bug">

<li>





<div class='inline'>
<p>In SketchUp 2023.1 this method didn&#39;t behave correctly on Windows. No known workarounds.</p>
</div>

</li>

</ul>

</div>
Expand Down
Loading

0 comments on commit 3258158

Please sign in to comment.