<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to get the transform of the section box through the API? in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9326228#M3647</link>
    <description>&lt;P&gt;I actually find a way to have changes update Navisworks:&lt;/P&gt;&lt;PRE&gt;var cvp = NavisworksApp.ActiveDocument?.CurrentViewpoint;
var vp = cvp?.Value;
var cps = vp?.InternalClipPlanes;
if (cps == null) return;

// DO CHANGES HERE, for example here we change the box (making it half size) if in box mode
if (cps.GetMode() != LcOaClipPlaneSetMode.eMODE_BOX) return;
BoundingBox3D box = new BoundingBox3D();
Rotation3D rotation = new Rotation3D();

cps.GetOrientedBox(box, rotation);
Vector3D dims = box.Size;
box = box.ExpandBy(-dims.X * 0.25, -dims.Y * 0.25, -dims.Z * 0.25);
cps.SetOrientedBox(box, rotation);

// surprisingly we have to copy the viewpoint back into the document then everything is refreshed correctly:		NavisworksApp.ActiveDocument.CurrentViewpoint.CopyFrom(vp);&lt;/PRE&gt;&lt;P&gt;Sure should have better ways, but at least that's a good working start &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 19:43:40 GMT</pubDate>
    <dc:creator>alexisDVJML</dc:creator>
    <dc:date>2020-02-18T19:43:40Z</dc:date>
    <item>
      <title>Is it possible to get the transform of the section box through the API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/8149487#M3644</link>
      <description>&lt;P&gt;I am wondering if there is any way of getting information about the section box in Navisworks. I have been able to get the normal and distance of enabled section planes but have not found any info about the section box.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 18:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/8149487#M3644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-23T18:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the transform of the section box through the API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/8278042#M3645</link>
      <description>&lt;P&gt;Hi Vanessa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can access section box information by de-serializing clipping planes JSON of active view:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get instance of Autodesk.Navisworks.Api.View which is your current active view (this can be got from Document.ActiveView);&lt;/LI&gt;&lt;LI&gt;View.GetClippingPlanes() will return you a JSON string which contains OrientedBox property.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 12:04:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/8278042#M3645</guid>
      <dc:creator>vilchishin</dc:creator>
      <dc:date>2018-09-19T12:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the transform of the section box through the API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9324772#M3646</link>
      <description>&lt;P&gt;You can get full details of the Section Box, aka mode, bounding box, oriented box or planes etc by accessing the LcOaClipPlaneSet object of the active viewpoint:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;var cps =NavisworksApp.ActiveDocument?.CurrentViewpoint.ToViewpoint()?.InternalClipPlanes;

var m = cps.GetMode();
bool enabled = cps.IsEnabled();

BoundingBox3D box = new BoundingBox3D(); Rotation3D rotation = new Rotation3D();
cps.GetOrientedBox(box, rotation);
 // etc...&lt;/PRE&gt;&lt;P&gt;However, while you can change these values by calling various SetXXX methods, I have not found yet how to have these changes be reflected in Navisworks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Which is sad since such API is much cleaner and efficient than having to parse/construct JSON strings.&lt;BR /&gt;Anyone has a way to have such changes really applied?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 09:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9324772#M3646</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2020-02-18T09:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the transform of the section box through the API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9326228#M3647</link>
      <description>&lt;P&gt;I actually find a way to have changes update Navisworks:&lt;/P&gt;&lt;PRE&gt;var cvp = NavisworksApp.ActiveDocument?.CurrentViewpoint;
var vp = cvp?.Value;
var cps = vp?.InternalClipPlanes;
if (cps == null) return;

// DO CHANGES HERE, for example here we change the box (making it half size) if in box mode
if (cps.GetMode() != LcOaClipPlaneSetMode.eMODE_BOX) return;
BoundingBox3D box = new BoundingBox3D();
Rotation3D rotation = new Rotation3D();

cps.GetOrientedBox(box, rotation);
Vector3D dims = box.Size;
box = box.ExpandBy(-dims.X * 0.25, -dims.Y * 0.25, -dims.Z * 0.25);
cps.SetOrientedBox(box, rotation);

// surprisingly we have to copy the viewpoint back into the document then everything is refreshed correctly:		NavisworksApp.ActiveDocument.CurrentViewpoint.CopyFrom(vp);&lt;/PRE&gt;&lt;P&gt;Sure should have better ways, but at least that's a good working start &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 19:43:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9326228#M3647</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2020-02-18T19:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the transform of the section box through the API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9369917#M3648</link>
      <description>&lt;P&gt;An even simpler way to change current document AND view Sectioning state and have it refreshed:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var oav = Application.ActiveDocument.State.GetViewer();
var cps = oav.GetClipPlaneSet();
// Change CPS mode, planes etc here
...
//

// Ensure UI is updated
oav.RequestRedraw(LcOaViewerRedrawType.eREDRAW_UPDATE);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 18:36:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-it-possible-to-get-the-transform-of-the-section-box-through/m-p/9369917#M3648</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2020-03-10T18:36:22Z</dc:date>
    </item>
  </channel>
</rss>

