Reply

Assembly file

Hallo ,

I want to open  Part file and Assembly file :

  assembly = (SolidEdgeAssembly.AssemblyDocument)documents.Add("SolidEdge.AssemblyDocument", Missing.Value);
  part = (SolidEdgePart.PartDocument)documents.Add("SolidEdge.PartDocument", Missing.Value);
  part=(SolidEdgePart.PartDocument)documents.Open(@"C:\Users\Mara\Desktop\Trafo\tole.par", Missing.Value);
assembly = (SolidEdgeAssembly.AssemblyDocument)documents.Open(@"C:\Users\Mara\Desktop\Trafo.asm", Missing.Value);

 

but only the Part file is opening by Assembly file give me Error Message :" cannot access specifeid file C:\Users\Mara\Desktop\Trafo.asm ".

Please Help .

Raja

3 REPLIES

Re: Assembly file

In my testing, the following code works:

 

[STAThread]
static void Main(string[] args)
{
    var filename = @"C:\Program Files\Solid Edge ST7\Training\Coffee Pot.asm";
    var application = SolidEdgeCommunity.SolidEdgeUtils.Connect(true, true);
    var documents = application.Documents;
    var fileInfo = new System.IO.FileInfo(filename);
            
    // Make sure the file exists.
    if (fileInfo.Exists)
    {
        var document = documents.Open(filename);
    }
}

 I suppose there are several possibilities on why you're seeing the error.

  • The file specified may not actually exists.
  • The file may be saved in a newer version of Solid Edge.
  • The file may be corrupt.

Some thoughts:

  • Have you tried opening the file via the GUI?
  • Other than the 'Filename' parameter, the other parameters are optional. Try omitting all but 'Filename'.
  • Have you tried opening other assemblies besides the one you mention?
Jason Newell
Applications Architect
www.jasonnewell.net

Re: Assembly file

Hi Jnewell ,

Thank you very match for your Answer.

I tried one other assembly file to open and has  worked.

both assembly files are in the same document. (I have both files opened via GUI) .
the only difference that the first file assembly are of the same parts but the other is of different parts ( like the Picture ).

 

 

I do not understand why the file that I need can  not be opened.

Please I need your help

Thanks 

Raja 

 

Re: Assembly file

Can you share the files so that we can take a look at it?

Jason Newell
Applications Architect
www.jasonnewell.net