swRayTraceRenderer.DisplayPreviewWindow not working in C#..?? OK in VB

In a VB plug-in, this call works fine to invoke the PV preview window:

status = swRayTraceRenderer.DisplayPreviewWindow

In a C# plug-in, the same call does nothing.

status = swRayTraceRenderer.DisplayPreviewWindow();

I appear to have a good/valid swRayTraceRenderer object.  Initialized like so:

swRayTraceRenderer = (RayTraceRenderer)iSwApp.GetRayTraceRenderer((int)swRayTraceRenderType_e.swPhotoView);

PV is added in and can be invoked manually.

I'm stumped.  Why would it work in VB and fail in C#???

SolidworksApi macros
Answers 2
RB
RB 2014-11-16 Best Answer

So I made a brand new c# plug-in from the VS template, and things worked...

The only difference is in my proper c# add-in, i've changed the build configuration to be x64 specific.

RB
RB 2014-11-16

OK.  Never mind me.

In my proper c# plug-in, I was inside my own command (pm page) when trying to invoke PV.  Once I moved the PV exectution to the AfterClose event, it works fine.

Although, it didnt' help that the return values from the PV commands didn't return anything other than 1...same as they do when they're successful.  If PV is in a disabled state b/c you're in another command, you'd think trying to execute a command on swRayTraceRenderer would return some kind of error value....