NW之模型的快速、平滑定位

在查看模型的過程中,我們常會用到模型定位,下面我介紹兩種模型定位的擴展方法。

快速定位

/// <summary>
/// 快速縮放.
/// </summary>
/// <param name="items">The items.</param>
public static void FastZoom(this IEnumerable<ModelItem> items)
{
    Document doc = Application.ActiveDocument;
    doc.CurrentSelection.CopyFrom(items);
    ComApiBridge.State.ZoomInCurViewOnCurSel();
    if (!doc.CurrentSelection.IsEmpty)
        doc.CurrentSelection.Clear();
}

平滑定位

/// <summary>
/// 平滑縮放.
/// </summary>
/// <param name="items">The items.</param>
public static void SmoothZoom(this IEnumerable<ModelItem> items)
{
    Document doc = Application.ActiveDocument;
    doc.CurrentSelection.CopyFrom(items);
    Autodesk.Navisworks.Api.Interop.LcRmAutoCAM.OnZoomSelected();
    if (!doc.CurrentSelection.IsEmpty)
        doc.CurrentSelection.Clear();
}

不同的定位方式會帶來不同的效果。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章