Solid Works and .dll component

May 10, 2004 2 Replies

Hello,



I have the following code compiled as an .exe file and it works just fine but when i try to compile it as an .dll file and run it from the web i get an error.



Here is the code :



Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long Dim Annotation As Object Dim Gtol As Object Dim DatumTag As Object Dim FeatureData As Object Dim Feature As Object Dim Component As Object Dim PartTitle As String



Sub StartPrint() Set swApp = Server.CreateObject("SldWorks.Application") Set Part = swApp.OpenDoc2("D:\Skivetest.SLDPRT", 1, 0, 0, 0, longstatus) Set Part = swApp.ActiveDoc Part.PrintDirect swApp.CloseDoc "Skivetest" swApp.ExitApp End Sub



Here is the Error :



Object required


If someone has any experiance with this i will like to here from you.



I'm using Solidworks 2003 on a win 2000 server with sp4 just to let you know.



Regards, Websam


from the web ??? what are you trying to do ? Did you add "SldWorks 2004 Type Library" in the "References" in VB?

Hi Philippe

Im trying to run the .dll from a asp site and from there people can choose a product and then let solid works make the drawing to show to the customer. The code i provided you with is just to test if i can make it as a .dll. The test code provided should just take a drawing and print it out on my printer. And as i wrote it works just fine as a .exe file.

And yes i have added both SldWorks 2003 Type Library and SolidWorks Exxtensibility Type Library > > I have the following code compiled as an .exe file and it works just

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required