×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NXOpen Automating switching to Plain background?

NXOpen Automating switching to Plain background?

NXOpen Automating switching to Plain background?

(OP)
thread561-220758: Open CDF

I am hoping someone can help me with how I can go about automating a change to the background color in NX 3 upwards.

As part of an automated program I want to change the color to a high contrast one for use in taking a screenshots for presentations.

I know that I can use a Macro to do this, recording the visualization preferences selections, and assign the macro to a button. But I want to do it all within an NX program.

It is tempting to cheat but from what I have been told there is no way to call a macro in a program...

So to go about it correctly I have so far found the following of use.

The wrapped UFunc ufSession.Disp.SetColor
eg in C# using a Double array for Red Green Blue Values you can set the background color.  Example code.

double[] rgb = new double[3];
//Red
rgb[0] = Math.Round(100.0/255.0, 7);
//Green
rgb[1] = Math.Round(100.0/255.0, 7);
//Blue
rgb[2] = Math.Round(102.0/255.0, 7);
ufSession.Disp.SetColor(0, NXOpen.UF.UFConstants.UF_DISP_rgb_model, "MYCOLOR", rgb);

This is great and does set the background color but if the model was being displayed in shaded mode this doesn't change anything visually.

Therefore does anyone know a way to make program NX to make it change to plain background?

Are there any other work arounds you can think of? Such as a way to program NX to apply a visualization template such as was talked about on previous threads.

Thanks for your interst.


 

RE: NXOpen Automating switching to Plain background?

Yes but you could put a macro under an icon and run everything that you need from there.

What you might want to do if you simply don't like the system defaults out of the box is to go through and change the template parts and some of the scratch part files used in translations.

Best Regards

Hudson

www.jamb.com.au

Nil Desperandum illegitimi non carborundum

RE: NXOpen Automating switching to Plain background?

(OP)
Yes that would be a possible workaround.  
Have the macro change the background then fire the program.

I was hoping for a way to have the whole thing programmed but I guess that is not possible at this stage.

RE: NXOpen Automating switching to Plain background?

(OP)
Thanks..

RE: NXOpen Automating switching to Plain background?

I seem to remember that there may be and action on part open that could similarly run a macro as some kind of possibility, but I omitted discussing it because it doesn't capture the components of an assembly in any case.

Sometimes I wonder whether it wouldn't in fact be preferable if some of the background, line width, selection colours and Colour Palettes in general weren't defined within the system as user specific setting rather than properties of the part files. It seems to me that in that manner you could satisfy everybody at once and dispense with the hassle of setting and resetting these defaults. I swear that some users must be colour blind by the colours that they make things, and in fact that may well be the case and a serious issue for some users.

Best Regards

Hudson

www.jamb.com.au

Nil Desperandum illegitimi non carborundum

RE: NXOpen Automating switching to Plain background?

Yes, using Menuscripts you can add pre- and post- actions to any menu item in NX.  These can be any executable programs or other application as long as you can launch it from a command-line.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: NXOpen Automating switching to Plain background?

Have you tried in NX 6.0.2 the Background class

    Background.BackgroundType = Background.Type.Plain;

Suresh
www.technisites.com.au

RE: NXOpen Automating switching to Plain background?

(OP)
Now that sounds extremely promising!  

I am in the process of being upgraded to 6 so will let you know as soon as I can test it.  But as long as it does exactly what it says on the tin it would seem to be the exact thing that I was looking for.  

Thanks very much.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources