cancel
Showing results for 
Search instead for 
Did you mean: 

Change workpart background color

Creator
Creator

Dear community,

 

I am looking for a way to set the background color of the workpart to plain and a fixed color, e.g. RGB(200,200,200) (Greyscale).

 

It has to happen in the Shaded with edges mode, which I already can set via this code.

 

workPart.ModelingViews.WorkView.RenderingStyle = NXOpen.View.RenderingStyleType.ShadedWithEdges

 

But I didn't find any way to change the background color, which seems a bit odd. Something so simple cannot be changed via nxOpen?

 

I tried the following code, I don't get an error but there is also nothing happing. But Scaleadjustment, Fit and ShadeWithEgdes work.

 

Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
    Sub Main(ByVal args() As String)

        Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
        Dim workPart As NXOpen.Part = theSession.Parts.Work
        Dim displayPart As NXOpen.Part = theSession.Parts.Display
        Dim backGround As NXOpen.Display.Background
        Dim topcolor As Double() = {1.0, 1.0, 1.0}
        Dim bottomColor As Double() = {1.0, 1.0, 1.0}

        workPart.ModelingViews.WorkView.Orient(NXOpen.View.Canned.Isometric, NXOpen.View.ScaleAdjustment.Current)
        workPart.ModelingViews.WorkView.Fit()
        workPart.ModelingViews.WorkView.RenderingStyle = NXOpen.View.RenderingStyleType.ShadedWithEdges


        backGround = workPart.Views.CreateBackground(workPart.Views.WorkView, False)
        backGround.BackgroundType = (NXOpen.Display.Background.Type.Plain)

        backGround.SetTopColor(topcolor)
        backGround.SetBottomColor(bottomColor)

        backGround.Commit()
        backGround.Destroy()
    End Sub
End Module

 

Looking forward to a response.

 

Kind regards

 

Mathieu

4 REPLIES

Re: Change workpart background color

Honored Contributor
Honored Contributor

The "background" object that you created is only for use with the "studio" shaded mode and high quality rendering, it does not affect the shaded or wireframe background. To the best of my knowledge, there is no way to change the shaded or wireframe background color through the API. I'd suggest contacting GTAC and opening an enhancement request (ER).

Re: Change workpart background color

Creator
Creator

Hi,

 

okay thank you for the reply.

 

I did not find any email.

 

http://www.plm.automation.siemens.com/de_de/support/gtac/gtac-hours.shtml#lightview-close

 

Is this the right page?

 

Kind regards

 

Mathieu

Re: Change workpart background color

Esteemed Contributor
Esteemed Contributor

http://webtac.industrysoftware.automation.siemens.com/qtac/index.php5?lang=de is the correct page to enter problem reports and such.

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: Change workpart background color

Creator
Creator
Thank you very much for the link.

Regards

Mathieu