Deleting partDocument.NewWindow



I am creating a new PartDocument Window using

Window partWindow = partDocument.NewWindow(...)

However, when I try deleting just the Window using

delete(partWindow), the part closes with it.

Am I supposed to set the Window to Invisible and then set partWindow = null or something?

It seems weird that there's a command to create a NewWindow, but none for deleting it properly.




Posted by: Chahe Adourian
Post date: 9/20/2008 7:13:40 AM


RE: Deleting partDocument.NewWindow


Is this what you're wanting? using System;using System.Collections.Generic;using System.Reflection;using System.Runtime.InteropServices;using System.Text;namespace PartWindow{ class Program { static void Main(string[] args) { SolidEdgeFramework.Application application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application"); SolidEdgePart.PartDocument part = (SolidEdgePart.PartDocument)application.ActiveDocument; SolidEdgeFramework.Window window = (SolidEdgeFramework.Window)part.NewWindow(Missing.Value, Missing.Value); window.Close(Missing.Value, Missing.Value, Missing.Value); } }}


Posted by: Jason Newell
Post date: 9/21/2008 7:22:35 PM

RE: Deleting partDocument.NewWindow


Hello Jason,



I've been trying Window.Close method with different parameters but always with the same consequence: the Parent object is no longer accessible afterwards.

For example,



 Window partWindow = (Window)objDoc.NewWindow(SolidEdgeConstants.NewWindowOptionConstants.igNewWindowTransient, Missing


.. Use the window to generate a picture snapshot

partWindow.Close(Missing.Value, Missing.Value, Missing.Value)  

After that objDoc.Name throws an exception.

Closing the window seems to have an additional effect of closing access to its parent. Is this a bug?





Posted by: Chahe Adourian
Post date: 9/22/2008 1:27:00 PM