Showing results for 
Search instead for 
Do you mean 
Reply

Color Tolbar hints for start

Hello,

 

is it possible to make color toolbar whic stays on while I am work in nx.

For exmp. i am modeling and what to change color of body, face, line or smth, color toolbar is on, i click on face and than on color in toolbar, color of face is changed and toolbar is on, i can do it as many time as i wish.

 

Can u give me hints how to i do it, or where to start.

 

can i do it with jurnal not like external app in vb.

6 REPLIES

Re: Color Tolbar hints for start

If you select an element within NX you can access this by using the SelectionManager (code in C#):

NXOpen.Selection MySelection = NXOpen.UI.GetUI().SelectionManager

 

To check if there are any selected elements use:

int Count = MySelection.GetNumSelectedObjects()

 


To access a specific selected element use:

var element = Selection.GetSelectedTaggedObject(0);

 

Use "element" to change the color or whatever.

 

You can add this program to a toolbar, which will be on screen all te time.

I have added a custom program to the radial flyout on selecting a component

RadialFlyout.jpg

Hope this helps

Herbert Macho
EBNER Industrieofenbau
AUSTRIA

NX10.0.3.5 (TeamCenter10 and Native)

Re: Color Tolbar hints for start

i want smthg like thise, but with much more colors.

https://www.youtube.com/watch?v=Cg-lXgkMGxU

Re: Color Tolbar hints for start

You can do this with a NX dialog (UIStyler/BlockStyler --> license required) or a WinForm.

If using a WinForm with selection you cannot set the unload option to IMMEDIATELY

public static int GetUnloadOption(string arg)
{
    return System.Convert.ToInt32(
        NXOpen.Session.LibraryUnloadOption.Immediately);
}

 

I'm not sure if you can use dialogs in a journal? (I don't use journals Smiley Embarassed

Herbert Macho
EBNER Industrieofenbau
AUSTRIA

NX10.0.3.5 (TeamCenter10 and Native)

Re: Color Tolbar hints for start

I found this topic: http://www.nxjournaling.com/content/using-winforms-journals

 

i guess it ll be hard way.

 

And is it possible that jurnal stay on while modeling. Can i run other jurnals if that one is on.

 

Thx.

Re: Color Tolbar hints for start

Yes, this is possible but a bit more tricky.
You have to use a "non modal" dialog. (use method .Show()) instead of a "modal" dialog ( .ShowDialog()).
Herbert Macho
EBNER Industrieofenbau
AUSTRIA

NX10.0.3.5 (TeamCenter10 and Native)

Re: Color Tolbar hints for start

You cannot use a non-modal dialog if you run your code as a journal. You would need to compile it to a dll file (NX author license required).