Delphi Application and AutoCAD 2002

Delphi Application and AutoCAD 2002

Anonymous
Not applicable
955 Views
13 Replies
Message 1 of 14

Delphi Application and AutoCAD 2002

Anonymous
Not applicable
Hi, I've develope a little Delphi Application that open AutoCAD 2002 and insert two lines. In my PC all works fine. In another PC where AutoCAD 2002 is installed the application is able to open AutoCAD but, when I try to insert the line I get the following error: Class not registered. Any ideas? Thank you in advance. Regards. Keven Corazza SierraSoft
0 Likes
956 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable
Can't tell you much without seeing the code. If you can't find the error, post the lines of code where it occurs. -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Keven Corazza" wrote in message news:40364a1e$1_3@newsprd01... > Hi, I've develope a little Delphi Application that open AutoCAD 2002 and > insert two lines. In my PC all works fine. In another PC where AutoCAD 2002 > is installed the application is able to open AutoCAD but, when I try to > insert the line I get the following error: > > Class not registered. > > Any ideas? > > Thank you in advance. > > Regards. > > Keven Corazza > SierraSoft > >
0 Likes
Message 3 of 14

Anonymous
Not applicable
This is my code: type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private AcadApp: IAcadApplication; function TestAcadAvailable: Boolean; function RunAutoCad: Boolean; procedure AddLines; end; ... procedure TForm1.Button1Click(Sender: TObject); begin if RunAutoCad(False) then AddLines; end; function TForm1.TestAcadAvailable: Boolean; begin Result:=True; try AcadApp:=GetActiveOleObject('AutoCAD.Application.15') as IAcadApplication; // is 'AutoCAD.Application.15' correct ? except AcadApp:=nil; Result:=False; end; end; function TForm1.RunAutoCad: Boolean; begin AcadApp:=nil; Screen.Cursor:=crHourGlass; if not(TestAcadAvailable) then begin AcadApp:=CreateOleObject('AutoCAD.Application.15') as IAcadApplication; // AcadApp:=CoAcadApplication.Create; AcadApp.Visible:=True; Application.BringToFront; end; Screen.Cursor:=crDefault; if AcadApp<>nil then begin if AcadApp.Documents.Count=0 then AcadApp.Documents.Add(''); Result:=True; end else Result:=False; end; procedure TForm1.AddLines; var p1,p2,p3,p4: OleVariant; begin p1:=VarArrayCreate( [0, 2], varDouble ); p1[0]:=0; p1[1]:=0; p1[2]:=0; p2:=VarArrayCreate( [0, 2], varDouble ); p2[0]:=50; p2[1]:=50; p2[2]:=50; p3:=VarArrayCreate( [0, 2], varDouble ); p3[0]:=0; p3[1]:=50; p3[2]:=0; p4:=VarArrayCreate( [0, 2], varDouble ); p4[0]:=50; p4[1]:=0; p4[2]:=0; AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); AcadApp.ZoomExtents; end; Thank you in advance. Regards. Keven Corazza SierraSoft
0 Likes
Message 4 of 14

Anonymous
Not applicable
Does the problem occur when AutoCAD is already running, or when it is not running and is started, or both? And, exactly what line of code does the exception occur on? -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Keven Corazza" wrote in message news:4036fe80$1_3@newsprd01... > This is my code: >
0 Likes
Message 5 of 14

Anonymous
Not applicable
I get the error when the software execute the AddLine method. Thank you in advance. Keven Corazza SierraSoft "Tony Tanzillo" ha scritto nel messaggio news:4037b92b$1_1@newsprd01... > Does the problem occur when AutoCAD is already running, > or when it is not running and is started, or both? And, > exactly what line of code does the exception occur on? > > -- > AcadXTabs: MDI Document Tabs for AutoCAD > http://www.acadxtabs.com > > AcadX for AutoCAD 2004 Beta 1 > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > "Keven Corazza" wrote in message news:4036fe80$1_3@newsprd01... > > This is my code: > > > >
0 Likes
Message 6 of 14

Anonymous
Not applicable
If the error occurs on the call to AddLine, it is a problem with OLE registration. The only fix I know of is to reinstal AutoCAD. -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Keven Corazza" wrote in message news:403a12a9_2@newsprd01... > I get the error when the software execute the AddLine method. > > Thank you in advance. > > Keven Corazza > SierraSoft > > > "Tony Tanzillo" ha scritto nel messaggio > news:4037b92b$1_1@newsprd01... > > Does the problem occur when AutoCAD is already running, > > or when it is not running and is started, or both? And, > > exactly what line of code does the exception occur on? > > > > -- > > AcadXTabs: MDI Document Tabs for AutoCAD > > http://www.acadxtabs.com > > > > AcadX for AutoCAD 2004 Beta 1 > > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > > > > "Keven Corazza" wrote in message > news:4036fe80$1_3@newsprd01... > > > This is my code: > > > > > > > > >
0 Likes
Message 7 of 14

Anonymous
Not applicable
Trying changing the following 2 lines AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); to be this AcadApp.ActiveDocument.ModelSpace.AddLine(p1,p2); AcadApp.ActiveDocument.ModelSpace.AddLine(p3,p4); "Tony Tanzillo" wrote in message news:403a28eb_1@newsprd01... > If the error occurs on the call to AddLine, it is a > problem with OLE registration. The only fix I know of > is to reinstal AutoCAD. > > -- > AcadXTabs: MDI Document Tabs for AutoCAD > http://www.acadxtabs.com > > AcadX for AutoCAD 2004 Beta 1 > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > "Keven Corazza" wrote in message news:403a12a9_2@newsprd01... > > I get the error when the software execute the AddLine method. > > > > Thank you in advance. > > > > Keven Corazza > > SierraSoft > > > > > > "Tony Tanzillo" ha scritto nel messaggio > > news:4037b92b$1_1@newsprd01... > > > Does the problem occur when AutoCAD is already running, > > > or when it is not running and is started, or both? And, > > > exactly what line of code does the exception occur on? > > > > > > -- > > > AcadXTabs: MDI Document Tabs for AutoCAD > > > http://www.acadxtabs.com > > > > > > AcadX for AutoCAD 2004 Beta 1 > > > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > > > > > > > "Keven Corazza" wrote in message > > news:4036fe80$1_3@newsprd01... > > > > This is my code: > > > > > > > > > > > > > > > >
0 Likes
Message 8 of 14

Anonymous
Not applicable
No , that has nothing to do with it. -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Joe Sutphin" wrote in message news:403a6760$1_1@newsprd01... > Trying changing the following 2 lines > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); > > to be this > > AcadApp.ActiveDocument.ModelSpace.AddLine(p1,p2); > AcadApp.ActiveDocument.ModelSpace.AddLine(p3,p4); > >
0 Likes
Message 9 of 14

Anonymous
Not applicable
Did you try it? "Tony Tanzillo" wrote in message news:403bd093_3@newsprd01... > No , that has nothing to do with it. > > -- > AcadXTabs: MDI Document Tabs for AutoCAD > http://www.acadxtabs.com > > AcadX for AutoCAD 2004 Beta 1 > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > "Joe Sutphin" wrote in message news:403a6760$1_1@newsprd01... > > Trying changing the following 2 lines > > > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); > > > > to be this > > > > AcadApp.ActiveDocument.ModelSpace.AddLine(p1,p2); > > AcadApp.ActiveDocument.ModelSpace.AddLine(p3,p4); > > > > > >
0 Likes
Message 10 of 14

Anonymous
Not applicable
I've tried but the problem is the same. The strange thing is that in other Acad 2002 the sofware works. Can be related to other application (ARX, LISP, ...) that AutoCAD load ? Keven Corazza SierraSoft "Joe Sutphin" ha scritto nel messaggio news:403c90f3$1_2@newsprd01... > Did you try it? > > "Tony Tanzillo" wrote in message > news:403bd093_3@newsprd01... > > No , that has nothing to do with it. > > > > -- > > AcadXTabs: MDI Document Tabs for AutoCAD > > http://www.acadxtabs.com > > > > AcadX for AutoCAD 2004 Beta 1 > > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > > > > "Joe Sutphin" wrote in message > news:403a6760$1_1@newsprd01... > > > Trying changing the following 2 lines > > > > > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); > > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); > > > > > > to be this > > > > > > AcadApp.ActiveDocument.ModelSpace.AddLine(p1,p2); > > > AcadApp.ActiveDocument.ModelSpace.AddLine(p3,p4); > > > > > > > > > > > >
0 Likes
Message 11 of 14

Anonymous
Not applicable
Many times. I already know it works either way. -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Joe Sutphin" wrote in message news:403c90f3$1_2@newsprd01... > Did you try it? >
0 Likes
Message 12 of 14

Anonymous
Not applicable
Like I said, this has to be an OLE registration problem. Have you used any registry cleaners? My advice is to reinstall AutoCAD, and also try it on other systems if you can. Also, what version of Delphi are you using? -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Keven Corazza" wrote in message news:403cd303_1@newsprd01... > I've tried but the problem is the same. The strange thing is that in other > Acad 2002 the sofware works. Can be related to other application (ARX, LISP, > ...) that AutoCAD load ? > > Keven Corazza > SierraSoft > > > > > "Joe Sutphin" ha scritto nel messaggio > news:403c90f3$1_2@newsprd01... > > Did you try it? > > > > "Tony Tanzillo" wrote in message > > news:403bd093_3@newsprd01... > > > No , that has nothing to do with it. > > > > > > -- > > > AcadXTabs: MDI Document Tabs for AutoCAD > > > http://www.acadxtabs.com > > > > > > AcadX for AutoCAD 2004 Beta 1 > > > http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip > > > > > > > > > "Joe Sutphin" wrote in message > > news:403a6760$1_1@newsprd01... > > > > Trying changing the following 2 lines > > > > > > > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p1,p2); > > > > AcadApp.ActiveDocument.Database.ModelSpace.AddLine(p3,p4); > > > > > > > > to be this > > > > > > > > AcadApp.ActiveDocument.ModelSpace.AddLine(p1,p2); > > > > AcadApp.ActiveDocument.ModelSpace.AddLine(p3,p4); > > > > > > > > > > > > > > > > > > > >
0 Likes
Message 13 of 14

Anonymous
Not applicable
I'm quite sure, looking your experience on this field, that you are right. The problem is that I've tried on five PC, three works two doesn't work. The two where I have the problem belongs to one of my customers and they have a lot of application that runs on them. You know that with the new policy by Autodesk install AutoCAD means that you have to ask the installation code and all this request are recorded. Is there a way to repeat the ole registration without install autocad from the beginning ? Thank you for your help Keven Corazza SierraSoft
0 Likes
Message 14 of 14

Anonymous
Not applicable
I'm not sure what you mean by 'ask the installation code and all this request are recorded'. You can do a repair of the existing installation without having to enter anything. I don't know if Autodesk broke out the registration from the installer. Also, if there are lots of other applications installed on the customer's system, then that could be an indication of other problems as well. For example, I've seen the use of Visual LISP's LDATA completely hose AutoCAD registry information. -- AcadXTabs: MDI Document Tabs for AutoCAD http://www.acadxtabs.com AcadX for AutoCAD 2004 Beta 1 http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip "Keven Corazza" wrote in message news:403d98a8$1_1@newsprd01... > I'm quite sure, looking your experience on this field, that you are right. > The problem is that I've tried on five PC, three works two doesn't work. The > two where I have the problem belongs to one of my customers and they have a > lot of application that runs on them. > > You know that with the new policy by Autodesk install AutoCAD means that you > have to ask the installation code and all this request are recorded. > > Is there a way to repeat the ole registration without install autocad from > the beginning ? > > Thank you for your help > > Keven Corazza > SierraSoft > >
0 Likes