View Full Version : Sheet Sets in VB

2005-02-24, 12:32 AM
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 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.


Elise Moss

2005-02-26, 10:56 AM
The SSM API is based on managed code and cannot be used with VB.

2005-02-27, 08:26 AM
No, it's not managed. It's contained within the AutoCAD process which means you need to use either VBA, a VB6 ActiveX DLL or a VB/C# .NET assembly to access it - but not an EXE [which is out-of-process].

Elise, take the code I posted in the other ng, copy/paste it into a VB6 ActiveX DLL and it'll work fine....it should also work fine from VBA, too.

2005-02-28, 07:42 PM
I upgraded to VB.net, thinking that would be the best solution.

I am still migrating the code over and will post when I hit the next bug (as I undoubtably will).

Thanks for all your help!