Sheet Sets in VB

Sheet Sets in VB

Anonymous
Not applicable
1,366 Views
27 Replies
Message 1 of 28

Sheet Sets in VB

Anonymous
Not applicable
I am trying to write a program in VB6 to automate the plotting of sheet set packages. It works great until I get to the point where I atcually have to access the AutoCAD ActiveX control.

I have added the reference to AcSmComponents16 1.0 Type Library, as any of the other Autodesk components that I think might be needed.

However, I get the error:

"Specified module cannot be found"
on this line:

Set ssm = CreateObject("AcSmComponents.AcSmSheetSetMgr")

Partial sample code:

'has the user selected a drawing package
If lstdst.Text = "" Then
MsgBox "You must select a drawing package to plot."
Exit Sub
End If

' open the database
'create the db filestring
dstname = lstdst.Text
msgstring = "selected package = " & dstname
MsgBox msgstring
If dstname = "WGVU 179051" Then
dstname = "wgvu.dst"
End If
If dstname = "OETA 388041" Then
dstname = "oeta.dst"
End If
If dstname = "PAPPAS 144051" Then
dstname = "pappas.dst"
End If
If dstname = "SALES SAMPLE PACKAGE" Then
dstname = "sample sales dwgs.dst"
End If


filestring = "\\signastor\engineering\sheet sets\" & dstname
msgstring = "selected package = " & filestring
MsgBox msgstring

Set ssm = CreateObject("AcSmComponents.AcSmSheetSetMgr")
Set db = ssm.OpenDatabase(filestring, True)
' lock the database
Call db.LockDb(db)

Any assistance would be appreciated.

Thanks,

Elise Moss
www.mossdesigns.com
0 Likes
1,367 Views
27 Replies
Replies (27)
Message 21 of 28

Anonymous
Not applicable
Thanks! That makes sense since I could use the SSM API in VB.NET and the DLL is loaded from within AutoCAD with Netload. -- Best Regards, Jimmy Bergmark CAD and Database Developer Manager at www.pharmadule-emtunga.com Blog: http://jtbworld.blogspot.com JTB FlexReport (FLEXnet / FLEXlm report tool) - www.jtbworld.com/jtbflexreport SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm or download some freeware at www.jtbworld.com More on AutoCAD 2005; www.jtbworld.com/autocad2005.htm "Tony Tanzillo" wrote in message news:4220ced1$1_2@newsprd01... > See my other post, and visit MSDN and read up on > what 'OLE Automation-compatible' means, and the > limitations on ActiveX/COM servers that do not meet > that requirement (as is the case with the SSM API). > > It has nothing to do with managed/unmanaged code. > It is about in-process verses cross-process ActiveX. > > The SSM can be used from VB, provided the client > is loaded into AutoCAD's process (e.g., an ActiveX > DLL loaded with the GetInterfaceObject method). > > Since VBA is inherently an in-process client, there > is no problem using SSM from there. > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > "Jimmy Bergmark" wrote in message > news:4220b180_2@newsprd01... >> Can you then answer the question how SSM can be used in VB? >> Or is it just so that SSM API can only be used in managed code unless >> within VBA within AutoCAD? >> >> -- >> Best Regards, Jimmy Bergmark >> CAD and Database Developer Manager at www.pharmadule-emtunga.com >> Blog: http://jtbworld.blogspot.com >> JTB FlexReport (FLEXnet / FLEXlm report tool) - >> www.jtbworld.com/jtbflexreport >> SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm >> or download some freeware at www.jtbworld.com >> More on AutoCAD 2005; >> www.jtbworld.com/autocad2005.htm >> >> >> "Tony Tanzillo" wrote in message >> news:42208bb6$1_2@newsprd01... >>> "Jimmy Bergmark" wrote >>> >>>> The SSM API is based on managed code and cannot be used with VB. >>> >>> The SSM API is not based on managed code. >>> >>> -- >>> http://www.caddzone.com >>> >>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>> http://www.acadxtabs.com >>> >>> >> >> > >
0 Likes
Message 22 of 28

Anonymous
Not applicable
No, you are mistaken. Application context means the execution context of code, not the scope of variables. AFAIK, LISP code cannot execute in the application context. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:4220dbc7$1_1@newsprd01... > Correction. > Application context dll CAN be launched using > Visual Lisp and the blackboard. > > -- > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > "Tony Tanzillo" wrote in message news:4220d018_1@newsprd01... >> Almost forgot, there is one other requirement needed to use >> the SSM from an in-process VB ActiveX DLL, which is that >> the DLL code that calls the SSM must be executing in the >> application context. >> >> In other words, you can't load the dll from a Visual LISP >> function because the Visual LISP code executes in the >> document context, not the application context. >> >> To load a VB ActiveX dll that uses the SSM, you will need >> to use VBA. This requirement is mainly because the SSM >> has methods that open and activate documents, which >> as I'm sure you know, cannot be done from code that is >> running in the document context. >> >> -- >> http://www.caddzone.com >> >> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >> http://www.acadxtabs.com >> >> "Jimmy Bergmark" wrote in message news:4220b180_2@newsprd01... >>> Can you then answer the question how SSM can be used in VB? >>> Or is it just so that SSM API can only be used in managed code unless within VBA within AutoCAD? >>> >>> -- >>> Best Regards, Jimmy Bergmark >>> CAD and Database Developer Manager at www.pharmadule-emtunga.com >>> Blog: http://jtbworld.blogspot.com >>> JTB FlexReport (FLEXnet / FLEXlm report tool) - www.jtbworld.com/jtbflexreport >>> SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm >>> or download some freeware at www.jtbworld.com >>> More on AutoCAD 2005; >>> www.jtbworld.com/autocad2005.htm >>> >>> >>> "Tony Tanzillo" wrote in message news:42208bb6$1_2@newsprd01... >>>> "Jimmy Bergmark" wrote >>>> >>>>> The SSM API is based on managed code and cannot be used with VB. >>>> >>>> The SSM API is not based on managed code. >>>> >>>> -- >>>> http://www.caddzone.com >>>> >>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>> http://www.acadxtabs.com >>>> >>>> >>> >>> >> >> > >
0 Likes
Message 23 of 28

Anonymous
Not applicable
No, I'm NOT mistaken Just like I said, an application context VB ActiveX DLL CAN be launched using Visual Lisp and the blackboard. The DLL will be loaded JUST ONCE and will stay loaded and running even in cero document state, and will respond to all application events at any time they happen and is terminated when the acad app is terminated. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:4221133d_3@newsprd01... > No, you are mistaken. > > Application context means the execution context > of code, not the scope of variables. AFAIK, LISP > code cannot execute in the application context. > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > "Jorge Jimenez" wrote in message > news:4220dbc7$1_1@newsprd01... >> Correction. >> Application context dll CAN be launched using >> Visual Lisp and the blackboard. >> >> -- >> Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica >> >> >> "Tony Tanzillo" wrote in message >> news:4220d018_1@newsprd01... >>> Almost forgot, there is one other requirement needed to use >>> the SSM from an in-process VB ActiveX DLL, which is that >>> the DLL code that calls the SSM must be executing in the >>> application context. >>> >>> In other words, you can't load the dll from a Visual LISP >>> function because the Visual LISP code executes in the >>> document context, not the application context. >>> >>> To load a VB ActiveX dll that uses the SSM, you will need >>> to use VBA. This requirement is mainly because the SSM >>> has methods that open and activate documents, which >>> as I'm sure you know, cannot be done from code that is >>> running in the document context. >>> >>> -- >>> http://www.caddzone.com >>> >>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>> http://www.acadxtabs.com >>> >>> "Jimmy Bergmark" wrote in message >>> news:4220b180_2@newsprd01... >>>> Can you then answer the question how SSM can be used in VB? >>>> Or is it just so that SSM API can only be used in managed code unless >>>> within VBA within AutoCAD? >>>> >>>> -- >>>> Best Regards, Jimmy Bergmark >>>> CAD and Database Developer Manager at www.pharmadule-emtunga.com >>>> Blog: http://jtbworld.blogspot.com >>>> JTB FlexReport (FLEXnet / FLEXlm report tool) - >>>> www.jtbworld.com/jtbflexreport >>>> SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm >>>> or download some freeware at www.jtbworld.com >>>> More on AutoCAD 2005; >>>> www.jtbworld.com/autocad2005.htm >>>> >>>> >>>> "Tony Tanzillo" wrote in message >>>> news:42208bb6$1_2@newsprd01... >>>>> "Jimmy Bergmark" wrote >>>>> >>>>>> The SSM API is based on managed code and cannot be used with VB. >>>>> >>>>> The SSM API is not based on managed code. >>>>> >>>>> -- >>>>> http://www.caddzone.com >>>>> >>>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>>> http://www.acadxtabs.com >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
0 Likes
Message 24 of 28

Anonymous
Not applicable
Excuse me, but yes you are mistaken. We're not talking about 'launching', and we're not talking about the scope of the variable that holds the object, we're talking about the execution context of the code that calls the methods of the object. Any method of an object that is invoked from Visual LISP _ALWAYS_ executes in the same context as the calling Visual LISP code, which is always the document context. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:42211f62_2@newsprd01... > No, I'm NOT mistaken > > Just like I said, an application context VB ActiveX DLL > CAN be launched using Visual Lisp and the blackboard. > > The DLL will be loaded JUST ONCE and will stay loaded > and running even in cero document state, and will respond > to all application events at any time they happen > and is terminated when the acad app is terminated. > -- > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > "Tony Tanzillo" wrote in message news:4221133d_3@newsprd01... >> No, you are mistaken. >> >> Application context means the execution context >> of code, not the scope of variables. AFAIK, LISP >> code cannot execute in the application context. >> >> -- >> http://www.caddzone.com >> >> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >> http://www.acadxtabs.com >> >> "Jorge Jimenez" wrote in message news:4220dbc7$1_1@newsprd01... >>> Correction. >>> Application context dll CAN be launched using >>> Visual Lisp and the blackboard. >>> >>> -- >>> Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica >>> >>> >>> "Tony Tanzillo" wrote in message news:4220d018_1@newsprd01... >>>> Almost forgot, there is one other requirement needed to use >>>> the SSM from an in-process VB ActiveX DLL, which is that >>>> the DLL code that calls the SSM must be executing in the >>>> application context. >>>> >>>> In other words, you can't load the dll from a Visual LISP >>>> function because the Visual LISP code executes in the >>>> document context, not the application context. >>>> >>>> To load a VB ActiveX dll that uses the SSM, you will need >>>> to use VBA. This requirement is mainly because the SSM >>>> has methods that open and activate documents, which >>>> as I'm sure you know, cannot be done from code that is >>>> running in the document context. >>>> >>>> -- >>>> http://www.caddzone.com >>>> >>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>> http://www.acadxtabs.com >>>> >>>> "Jimmy Bergmark" wrote in message news:4220b180_2@newsprd01... >>>>> Can you then answer the question how SSM can be used in VB? >>>>> Or is it just so that SSM API can only be used in managed code unless within VBA within AutoCAD? >>>>> >>>>> -- >>>>> Best Regards, Jimmy Bergmark >>>>> CAD and Database Developer Manager at www.pharmadule-emtunga.com >>>>> Blog: http://jtbworld.blogspot.com >>>>> JTB FlexReport (FLEXnet / FLEXlm report tool) - www.jtbworld.com/jtbflexreport >>>>> SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm >>>>> or download some freeware at www.jtbworld.com >>>>> More on AutoCAD 2005; >>>>> www.jtbworld.com/autocad2005.htm >>>>> >>>>> >>>>> "Tony Tanzillo" wrote in message news:42208bb6$1_2@newsprd01... >>>>>> "Jimmy Bergmark" wrote >>>>>> >>>>>>> The SSM API is based on managed code and cannot be used with VB. >>>>>> >>>>>> The SSM API is not based on managed code. >>>>>> >>>>>> -- >>>>>> http://www.caddzone.com >>>>>> >>>>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>>>> http://www.acadxtabs.com >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
0 Likes
Message 25 of 28

Anonymous
Not applicable
So, are you affirming that I cannot load a DLL using Visual Lisp and be able to fully use the SSM API with that DLL ? -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:422120b2$1_1@newsprd01... > Excuse me, but yes you are mistaken. > > We're not talking about 'launching', and we're > not talking about the scope of the variable > that holds the object, we're talking about the > execution context of the code that calls the > methods of the object. > > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > "Jorge Jimenez" wrote in message > news:42211f62_2@newsprd01... >> No, I'm NOT mistaken >> >> Just like I said, an application context VB ActiveX DLL >> CAN be launched using Visual Lisp and the blackboard. >> >> The DLL will be loaded JUST ONCE and will stay loaded >> and running even in cero document state, and will respond >> to all application events at any time they happen >> and is terminated when the acad app is terminated. >> -- >> Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica >> >> "Tony Tanzillo" wrote in message >> news:4221133d_3@newsprd01... >>> No, you are mistaken. >>> >>> Application context means the execution context >>> of code, not the scope of variables. AFAIK, LISP >>> code cannot execute in the application context. >>> >>> -- >>> http://www.caddzone.com >>> >>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>> http://www.acadxtabs.com >>> >>> "Jorge Jimenez" wrote in message >>> news:4220dbc7$1_1@newsprd01... >>>> Correction. >>>> Application context dll CAN be launched using >>>> Visual Lisp and the blackboard. >>>> >>>> -- >>>> Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica >>>> >>>> >>>> "Tony Tanzillo" wrote in message >>>> news:4220d018_1@newsprd01... >>>>> Almost forgot, there is one other requirement needed to use >>>>> the SSM from an in-process VB ActiveX DLL, which is that >>>>> the DLL code that calls the SSM must be executing in the >>>>> application context. >>>>> >>>>> In other words, you can't load the dll from a Visual LISP >>>>> function because the Visual LISP code executes in the >>>>> document context, not the application context. >>>>> >>>>> To load a VB ActiveX dll that uses the SSM, you will need >>>>> to use VBA. This requirement is mainly because the SSM >>>>> has methods that open and activate documents, which >>>>> as I'm sure you know, cannot be done from code that is >>>>> running in the document context. >>>>> >>>>> -- >>>>> http://www.caddzone.com >>>>> >>>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>>> http://www.acadxtabs.com >>>>> >>>>> "Jimmy Bergmark" wrote in message >>>>> news:4220b180_2@newsprd01... >>>>>> Can you then answer the question how SSM can be used in VB? >>>>>> Or is it just so that SSM API can only be used in managed code unless >>>>>> within VBA within AutoCAD? >>>>>> >>>>>> -- >>>>>> Best Regards, Jimmy Bergmark >>>>>> CAD and Database Developer Manager at www.pharmadule-emtunga.com >>>>>> Blog: http://jtbworld.blogspot.com >>>>>> JTB FlexReport (FLEXnet / FLEXlm report tool) - >>>>>> www.jtbworld.com/jtbflexreport >>>>>> SmartPurger (Purges automatically) - >>>>>> www.jtbworld.com/?/smartpurger.htm >>>>>> or download some freeware at www.jtbworld.com >>>>>> More on AutoCAD 2005; >>>>>> www.jtbworld.com/autocad2005.htm >>>>>> >>>>>> >>>>>> "Tony Tanzillo" wrote in message >>>>>> news:42208bb6$1_2@newsprd01... >>>>>>> "Jimmy Bergmark" wrote >>>>>>> >>>>>>>> The SSM API is based on managed code and cannot be used with VB. >>>>>>> >>>>>>> The SSM API is not based on managed code. >>>>>>> >>>>>>> -- >>>>>>> http://www.caddzone.com >>>>>>> >>>>>>> AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 >>>>>>> http://www.acadxtabs.com >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
0 Likes
Message 26 of 28

Anonymous
Not applicable
> So, are you affirming that I cannot load a DLL > using Visual Lisp and be able to fully use the SSM API > with that DLL ? You would not be able to fully use the SSM API, because it has methods that can open and/or activate documents, and if that happens, your LISP code stops dead in its tracks. I never said you can't use the SSM API from document context code, what I said was that if you do, and the SSM method you call changes the active document, then your controlling LISP application is suspended. And, if you call an SSM method that opens and activates a document, or closes a document (not sure if there are any that do the latter), the chances you'll crash AutoCAD are fairly good. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com
0 Likes
Message 27 of 28

Anonymous
Not applicable
> You would not be able to fully use the SSM API, because > it has methods that can open and/or activate documents, > and if that happens, your LISP code stops dead in its > tracks So again, are affirming that an ActiveX DLL that was loaded using Visual Lisp will not be able to use the open and/or active document methods of the SSM API, and if it does it will crash Acad ?? -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:42212936$1_2@newsprd01... >> So, are you affirming that I cannot load a DLL >> using Visual Lisp and be able to fully use the SSM API >> with that DLL ? > > You would not be able to fully use the SSM API, because > it has methods that can open and/or activate documents, > and if that happens, your LISP code stops dead in its > tracks. > > I never said you can't use the SSM API from document > context code, what I said was that if you do, and the > SSM method you call changes the active document, > then your controlling LISP application is suspended. > > And, if you call an SSM method that opens and activates > a document, or closes a document (not sure if there are > any that do the latter), the chances you'll crash AutoCAD > are fairly good. > > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > >
0 Likes
Message 28 of 28

Anonymous
Not applicable
I want to start by thanking Tony Tanzillo and Jimmy B. for their discussion on this matter. Both of them helped clarify this issue for me quite a bit...the information they provided was wonderful, marvelous, and exceptional.

I agree with what Tony says, in theory, regarding accessing the SSM using LISP. I have to say "in theory" because I have not tried it myself, but I will take his word for it.

I have upgraded to VB.net from VB6 hoping that this will resolve the problem.

I appreciate Tony's advice about understanding dlls. I understand how to compile and load a dll, but I have done very little dll programming personally.

I am unclear regarding Jimmy's reference to Netload, but I am assuming once I start working in VB.net it will become clearer.

This thread has been enlightening to say the least!

Again, thanks to both Tony and Jimmy for their contributions.

Elise Moss
www.mossdesigns.com
0 Likes