Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Selection mask polygon geometry

Hello,

 

I'm having trouble setting my selectio mask for polygon geometry. I have read the post

http://community.plm.automation.siemens.com/t5/NX-Programming-Customization/Block-UI-Styler-How-to-s...

 

But I still don't manage to make it working. This is what I think my selection mask should be for a polygon body:

        Dim SelectionMaskPolygonBody(0) As Selection.MaskTriple
        
        With SelectionMaskPolygonBody(0)
            .Type = UF.UFConstants.UF_sfem_mesh_geometry_type
            .Subtype = UF.UFConstants.UF_sfem_mesh_geometry_body_subtype
        End With

        PolygonBodySelection0.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, SelectionMaskPolygonBody)

But I don't get any selection options when I run.

 

Kind regards,

Frederik

14 REPLIES

Re: Selection mask polygon geometry

Re: Selection mask polygon geometry

Hello Cowski1,

 

I have read this post, but I can not figure out. From this post I expect that when I use: 

.type = UF_sfem_mesh_geometry_type
.subtype = UF_smesh_geometry_body_subtype 

 I should be able to select polygon bodies only. However, when I run the program I cannot select anything.

 

I did manage for another input, to set my mask for mesh.

 

Regards,

frederik

Re: Selection mask polygon geometry

These only allow selecting of FEM meshes, for regular faceted bodies you would need a different selection mask.

From %UGII_BASE_DIR%\UGOPEN\uf_object_types.h:

#define UF_faceted_model_type                   139
#define    UF_faceted_model_normal_subtype             0
#define    UF_faceted_model_cloud_subtype              1
#define    UF_faceted_model_promoted_subtype           2
#define    UF_faceted_model_jt_body_subtype            3
#define    UF_faceted_model_face_subtype               4
#define    UF_faceted_model_edge_subtype               5
#define    UF_faceted_model_map_subtype                6
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Selection mask polygon geometry

Hello Stefan,

 

Using the UF_Faceted_model_type I get facet body as my mask.

 

But what I actually need is polygon body and polygon face. Do you kno w

 

regards,

frederik

Re: Selection mask polygon geometry

[ Edited ]

What kind of polygon, where did it come from?

What application are you working in, modeling, manufacturing or FEM?

Have you checked the file I mentioned for a type that has polygon in its name?

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Selection mask polygon geometry

Hello Stefan,

 

I'm working in the advanced simulation (FEM).

I want to have the mask set to polygon body and polygon face.

I have checked the file uf_obj_types.h for polygon, but it is not present.

 

In the link to the post from JimB you sent earlier, it is mentioned that polygon geometry is from the "UF_sfem_mesh_geometry_type" which I tried but doesn't work.

 

Regards,

Frederik

Re: Selection mask polygon geometry

I would use the (legacy) UF_OBJ_ask_type_and_subtype call (or the new equivalent) to get the object's type & subtype as numbers.

Then look in the various "*types.h" files to find a "name" associated.

Note that not all types are in uf_obj_types.h - IIRC, some have been split off to other files.

 

Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Selection mask polygon geometry

Thanks Ken_A,

 

This is a good pointer, but how do I call the UF_OBJ_ask_type_and_subtype?

 

According to the manual there is an NXopen.uf.ufobj.AskTypeAndSubtype, which acts as a wrapper for UF_OBJ_ask_type_and_subtype, but I cannot access this method.

 

This is the code I have:

Option Strict Off
Imports System
Imports NXOpen

Imports NXOpen.Utilities


Module Module2

    Sub Main()
        Dim theSession As Session = Session.GetSession()
        Dim theLW As ListingWindow = theSession.ListingWindow
        theLW.Open()

        Dim BasePart As BasePart = theSession.Parts.BaseWork
        Dim BaseFemPart As CAE.FemPart = CType(theSession.Parts.BaseWork, CAE.FemPart)
        Dim cAEBody1 As NXOpen.CAE.CAEBody = CType(BaseFemPart.FindObject("CAE_Body(1)"), NXOpen.CAE.CAEBody)

        Dim test1 As Int32 = Nothing
        Dim test2 As Int32 = Nothing

        UF.UFObj.AskTypeAndSubtype(cAEBody1, test1, test2)

        theLW.WriteFullline(test1.ToString)

    End Sub

End Module

 I get the error message:

"reference to a non-shared member requires an object reference"

 

Regards,

Frederik

 

 

Re: Selection mask polygon geometry

[ Edited ]

UF wrapper functions need an old tag, so you need to use the following.

In addition you need the UF session too.

 

UFSession.GetUFSession().UFObj.AskTypeAndSubtype(cAEBody1.Tag, test1, test2)

 

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community