NXOpen.UF.UFView.CycleObjects 的使用

來源:互聯網
上載者:User

標籤:

Public Sub CycleObjects(ByVal view As NXOpen.Tag, ByVal type As NXOpen.UF.UFView.CycleObjectsEnum, ByRef _object As NXOpen.Tag)     NXOpen.UF.UFView 的成員

在指定視圖中迴圈對象

1.如果視圖(view)為NULL_TAG(.NET:NXOpen.Tag.Null),則使用工作視圖。

2.type=UF_VIEW_VISIBLE_OBJECTS(.NET:NXOpen.UF.UFView.CycleObjectsEnum.VisibleObjects),返回視圖矩形邊界內的所有可見對象;不會返回跨越邊界或在邊界外的對象。不支援製圖成員的非矩形邊界,如果想擷取製圖成員的非矩形邊界視圖的可見對象,或跨越視圖邊界的對象,請使用UF_VIEW_ask_visible_objects。

3.在結束遍曆迴圈之前,不能刪除或者擦除對象,不能通過添加或移除視圖進行邊界。如果需要刪除遍曆尋找的對象,請建立一個數組,在遍曆結束以後,對對象數組進行刪除操作。

PS:這個功能將會返回用於顯示的實體輪廓邊緣(包括面和邊)。在使用者定義圖層(1~256層)中。

個人的理解是:

type=UF_VIEW_VISIBLE_OBJECTS,返回視圖邊界內的可見對象,包括實體輪廓。

type=UF_VIEW_DEPENDENT_OBJECTS ,返回視圖內的可以顯示的製圖對象(包括隱藏但可以顯示的製圖對象),不包括不能顯示的對象,不包括實體輪廓。

type=UF_VIEW_ERASED_OBJECTS,

type=UF_VIEW_MODIFIED_OBJECTS ,

下面的代碼,是擷取在工作視圖可以顯示的40層裡的注釋。

Dim theSession = Session.GetSession()        Dim workPart As Part = theSession.Parts.Work        Dim theUfSession = UFSession.GetUFSession()        Dim lw = theSession.ListingWindow        lw.Open        Dim _object = NXOpen.Tag.Null        Do            theUfSession.View.CycleObjects(NXOpen.Tag.Null, NXOpen.UF.UFView.CycleObjectsEnum.DependentObjects, _object)            If _object = NXOpen.Tag.Null Then                Exit Do            Else                Dim _type, _subtype As Integer                theUfSession.Obj.AskTypeAndSubtype(_object, _type, _subtype)                ‘lw.WriteLine(String.Format("Type:{0} Subtype:{1}", _type, _subtype))                If _type = UFConstants.UF_drafting_entity_type AndAlso _subtype = UFConstants.UF_draft_note_subtype Then                    Dim note1 As Annotations.Note = TryCast(Utilities.NXObjectManager.Get(_object), Annotations.Note)                    If note1 IsNot Nothing Then                        If note1.Layer = 40 Then                            ‘TODO:位於40層的注釋                            ‘theSession.Information.DisplayObjectsDetails({note1})                        End If                    End If                End If            End If        Loop While _object <> NXOpen.Tag.Null

NXOpen.UF.UFView.CycleObjects 的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.