Cancel
Showing results for 
Search instead for 
Did you mean: 

Geting pre-selected object list

Valued Contributor
Valued Contributor

Is there a way of getting a list of objects that are preselected on screen?

I'm trying to add a pre action to an NX function but need to know the list of input objects.

 

Thanks,

8 REPLIES

Re: Geting pre-selected object list

Honored Contributor
Honored Contributor

Search the GTAC solution center for "nxopen sample preselected", it will return a few hits. One that I find particularly handy while developing code for NX is nx_api4033 or "report type and subtype of preselected objects".

Re: Geting pre-selected object list

Valued Contributor
Valued Contributor
Thanks Cowski,

Unfortunately, due to the way we are set up here I don't have access to our companies webkey. As such I don't have access to the solutions center Smiley Surprised(

Re: Geting pre-selected object list

Honored Contributor
Honored Contributor

Here's the code example supplied by GTAC (Amy Webster).

 

Sample NX Open .NET Visual Basic program : report type and subtype of preselected objects

Note: 


GTAC provides programming examples for illustration only, and assumes that you are familiar 
with the programming language being demonstrated and the tools used to create and debug procedures. 
GTAC support professionals can help explain the functionality of a particular procedure, but we 
will not modify these examples to provide added functionality or construct procedures to meet your specific needs.


Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI

Module NXJournal

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim ufs As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession()
        Dim selobj As NXObject
        Dim type As Integer
        Dim subtype As Integer
        Dim lw As ListingWindow = theSession.ListingWindow

       Dim theSelection As Selection = UI.GetUI().SelectionManager

        For ii As Integer = 0 To theSelection.GetNumSelectedObjects() - 1
            selobj = theSelection.GetSelectedTaggedObject(ii)
            ufs.Obj.AskTypeAndSubtype(selobj.Tag, type, subtype)
            lw.Open()
            lw.WriteLine("Object: " & selobj.ToString())
            lw.WriteLine(" NXOpen Type: " & selobj.GetType().ToString())
            lw.WriteLine(" Tag: " & selobj.Tag.ToString())
            lw.WriteLine(" Type: " & type.ToString())
            lw.WriteLine(" Subtype: " & subtype.ToString())
        Next
    End Sub

   End Module


Re: Geting pre-selected object list

Esteemed Contributor
Esteemed Contributor

mark_benson wrote:
Thanks Cowski,

Unfortunately, due to the way we are set up here I don't have access to our companies webkey. As such I don't have access to the solutions center Smiley Surprised(

This forum needs the webkey too, so you should have access to the solution center.

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: NX12.0

How to Get the Most from Your Signature in the Community

Re: Geting pre-selected object list

Valued Contributor
Valued Contributor

Thanks Cowski, I really appreciate that.

 

Stefan, there are different levels of webkey.  Mine is for the forum only which unfortunately doesn't include the solution center.

 

Re: Geting pre-selected object list

Honored Contributor
Honored Contributor

You can find the Webkey access code if you go to Help -> about NX -> system information or Help -> log file... The licensing information will be near the top of the log file.

 

This code does not give you access to the Solution center?

Re: Geting pre-selected object list

Esteemed Contributor
Esteemed Contributor

There are two types of webkey, the one that gives you access to all services and the one that only allows access to the forums.

This has been mentioned once when the forum was started, migrated respectively.

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: NX12.0

How to Get the Most from Your Signature in the Community

Re: Geting pre-selected object list

Esteemed Contributor
Esteemed Contributor

Mark -

Given the info in  the log file, you can create your own webkey account, with access to uganswer.

I'm not sure if Siemens has things set up that "company X" webkey requests have to be approved by the company?

 

If you don't tell, I won't tell :-)

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