cancel
Showing results for 
Search instead for 
Did you mean: 

.Net code to pick a balloon ...

Valued Contributor
Valued Contributor

I have used the code below (from the NX example libraries) to let the user choose a view.

 

I would like to modify this to allow the user to pick an object (single occurrence or multiple objects) of the type show in the listing below:

 

-----------

Information on object # 1

 

Owning part K:\Dwg\Dwg\7XXXX\72498\72498012_DWG.prt

Type Circle-Balloon

 

---------------------

 

addme.jpg

I think that someone here is likely to know the MaskTriple .Type and .Subtype (if applicable) for this object type.

 

Function select_a_drawing_member_view(ByRef vw As View)

    Dim ui As UI = GetUI()
    Dim mask(0) As Selection.MaskTriple
        With mask(0)
            .Type = UFConstants.UF_view_type
            .Subtype = UFConstants.UF_view_imported_subtype
            .SolidBodySubtype = 0
        End With
    Dim cursor As Point3d = Nothing

    Dim resp As Selection.Response = _
    ui.SelectionManager.SelectObject("Select a drawing member view", _
        "Select a drawing member view", _
        Selection.SelectionScope.AnyInAssembly, _
        Selection.SelectionAction.ClearAndEnableSpecific, _
        False, False, mask, vw, cursor)

    If resp = Selection.Response.ObjectSelected Or _
       resp = Selection.Response.ObjectSelectedByName Then
        return Selection.Response.Ok
    Else
        return Selection.Response.Cancel
    End If

End Function

This is NX8.5

 

Thanks for any help.

 

SteveA
DRT Mfg. Co. Inc.
www.drtusa.com
Win7x64 NX8.5.3.3
2 REPLIES

Re: .Net code to pick a balloon ...

Phenom
Phenom

Here's the mask that I've used in other code:

With selectionMask_array(0)
    .Type = UFConstants.UF_drafting_entity_type
    .Subtype = UFConstants.UF_draft_id_symbol_subtype
End With

To find the type/subtype of a particular object, I use some code from the GTAC solution center:

http://solutions.industrysoftware.automation.siemens.com/view.php?si=nx_api3386

 

This will return the integer values for the type/subtype of the selected object. I then cross reference these numbers in the "uf_object_types.h" file (found in the NX install dir\UGOPEN folder) to get the UF constant that represents the type. I use the UF constants in my code to make it more readable/maintainable.

 

I've actually made a small VB program that looks up these values for me, but I've not released it "into the wild" yet.

Re: .Net code to pick a balloon ...

Valued Contributor
Valued Contributor

Thanks Cowski. It may be a few days until I am able to get back to this project. As usual - I expect that what you provided will do the trick.

 

Thanks again,

Steve A.

SteveA
DRT Mfg. Co. Inc.
www.drtusa.com
Win7x64 NX8.5.3.3