[solved]Trouble using BOMProperties

All topics about specific development with COM interface, LIP language, API in VB, ...

Moderators: remi77, jacs, Daniel

Beco
Private First Class
Private First Class
Posts: 10
Joined: Mon Jul 02, 2007 11:50 am
Location: Yambol, Bulgaria
Contact:

[solved]Trouble using BOMProperties

Unread post by Beco »

Hi,
When I add following line:
IBOMProperties properties = bomLevel1.Properties;
to my code it works only once, 2-nd run crash at line getting TopApp.
Is this a bug in API, or I do something wrong?

C# code:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using TopSolid;

namespace TestTopSolidBOM
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Start");
            TopSolid.Application TopApp = new TopSolid.Application();
            Console.WriteLine("TopSolid.Application");
            IDocument doc = TopApp.Documents.Load(@"C:\Projects\Samples\NewStepperLuxe\StepperLuxe.top", false, true, true);
            Console.WriteLine("TopSolid.IDocument");
            IDocumentDesign docDes = (IDocumentDesign)doc;
            IElement TopElt = (IElement)docDes.Assembly;
            BOM TopBom = doc.GetBOM(TopElt,@"C:\Missler\V68\bin\IdxDesRefMatCom.bom", true);
            IBOMLevels subl = TopBom.SubLevels;
            BOMLevel bomLevel1 = subl[1];
            //When I start program, first time all works fine, but
            /* Uncommenting next lines cause crash of this program,
              when I start it for 2-nd time, at line getting TopSolid.Application.
              after restart of TopSolid it runs again - only first time*/
            //IBOMProperties properties = bomLevel1.Properties;
            //IBOMProperty pr1 = properties[2];
            //Console.WriteLine(pr1.Value);
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
    }
}
Result from 1-st run:

Code: Select all

Start
TopSolid.Application
TopSolid.IDocument
Biellette
Press any key to continue...
Result from 2-nd run:

Code: Select all

Start
and exception:
Retrieving the COM class factory for component with CLSID {96DAB3E1-B2C2-4F2A-A175-91AA0275A714} failed due to the following error: 80010108.
; )
Holzknoten
Master Corporal
Master Corporal
Posts: 43
Joined: Fri Apr 29, 2011 7:16 am
TopSolid Module: TopSolid'Wood
TopSolid Version: 6.17
Location: Hannover
Contact:

Unread post by Holzknoten »

Did you fix your code?
by Holzknoten
Beco
Private First Class
Private First Class
Posts: 10
Joined: Mon Jul 02, 2007 11:50 am
Location: Yambol, Bulgaria
Contact:

Unread post by Beco »

My code is OK :D
and bug in API was fixed (nobody tells you)
I test on TopSolid 2007 x64 with latest update v.6.8.278
; )
Post Reply