Public Sub Cycleobjects (ByValasByValasByRef as nxopen.tag) Members of the NXOpen.UF.UFView
Looping objects in the specified view
1. If the view is Null_tag(. NET:NXOpen.Tag.Null), the work view is used.
2.type=uf_view_visible_objects(. NET:NXOpen.UF.UFView.CycleObjectsEnum.VisibleObjects), Returns all visible objects within the bounds of the view rectangle, and does not return objects that span boundaries or are outside the bounds. Non-rectangular boundaries for cartographic members are not supported, and if you want to get a visible object for a non-rectangular bounding view of a cartographic member, or an object that spans the view boundary, use uf_view_ask_visible_objects.
3. You cannot delete or erase an object until you have finished traversing the loop, and you cannot boundary by adding or removing views. If you need to delete the object that traverses the lookup, create an array and delete the object array after the traversal is finished.
PS: This feature will return the body contour edges (including faces and edges) for display. In the user-defined layer (1~256 layer).
the personal understanding is :
Type=uf_view_visible_objects, returns the visible object within the view boundary, including the solid outline.
Type=uf_view_dependent_objects , returns the cartographic objects that can be displayed in the view (including objects that are hidden but can be displayed), excluding objects that cannot be displayed, not including the solid outlines.
Type=uf_view_erased_objects,
Type=uf_view_modified_objects ,
The following code is a note that gets the 40 layers that can be displayed in the work view.
DimThesession =session.getsession ()DimWorkpart asPart =theSession.Parts.WorkDimTheufsession =ufsession.getufsession ()DimLW =Thesession.listingwindow LW. OpenDim_object =NXOpen.Tag.Null DotheUfSession.View.CycleObjects (NXOpen.Tag.Null, NXOpen.UF.UFView.CycleObjectsEnum.DependentObjects, _objec T)If_object = NXOpen.Tag.Null Then Exit Do Else Dim_type, _subtype as IntegerTheUfSession.Obj.AskTypeAndSubtype (_object, _type, _subtype)'LW. WriteLine (String.Format ("Type:{0} Subtype:{1}", _type, _subtype)) If_type = Ufconstants.uf_drafting_entity_typeAndAlso_subtype = Ufconstants.uf_draft_note_subtype Then DimNote1 asAnnotations.note =TryCast (Utilities.NXObjectManager.Get (_object), annotations.note)IfNote1IsNot Nothing Then IfNote1. Layer = + Then 'TODO: Comments on layer 40 'theSession.Information.DisplayObjectsDetails ({note1}) End If End If End If End If Loop while_object <> NXOpen.Tag.Null
Use of NXOpen.UF.UFView.CycleObjects