Message 1 of 20
array trouble - Argument not Optional

Not applicable
08-07-2002
01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I get an 'Argument not optional' error with the following code:
Dim arrCase(0 To 3) As AcadPlotConfigurations
Private Sub cmdGo_Click()
''Retrieve standard PlotConfigurations
''arrCase is an array of PlotConfigurations Collections
'' arrCase(0) => Cross Section sheets
'' arrCase(1) => 1:1 scale
'' arrCase(2) => 1:20 scale
'' arrCase(3) => 1:50 scale
Dim objDbxDoc As Object 'AxDbDocument
Set objDbxDoc =
AcadApplication.GetInterfaceObject("ObjectDBX.AxDbDocument")
objDbxDoc.Open "j:/1049/cad/submit/blocks/xspsetups.dwg"
arrCase(0) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/1psetups.dwg"
arrCase(1) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/20psetups.dwg"
arrCase(2) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/50psetups.dwg"
arrCase(3) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
Set objDbxDoc = Nothing
''rest of sub clipped
End Sub
The error occurs at the first attempt to set the array element to a
PlotConfigurations object. That is, the line "arrCase(0) =
objDbxDoc.CopyObjects(...)".
I can't figure out which argument is missing?
TIA
Adam Wuellner
Civiltech Engineering, Inc.
Dim arrCase(0 To 3) As AcadPlotConfigurations
Private Sub cmdGo_Click()
''Retrieve standard PlotConfigurations
''arrCase is an array of PlotConfigurations Collections
'' arrCase(0) => Cross Section sheets
'' arrCase(1) => 1:1 scale
'' arrCase(2) => 1:20 scale
'' arrCase(3) => 1:50 scale
Dim objDbxDoc As Object 'AxDbDocument
Set objDbxDoc =
AcadApplication.GetInterfaceObject("ObjectDBX.AxDbDocument")
objDbxDoc.Open "j:/1049/cad/submit/blocks/xspsetups.dwg"
arrCase(0) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/1psetups.dwg"
arrCase(1) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/20psetups.dwg"
arrCase(2) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
objDbxDoc.Open "j:/1049/cad/submit/blocks/50psetups.dwg"
arrCase(3) = objDbxDoc.CopyObjects(objDbxDoc.PlotConfigurations)
Set objDbxDoc = Nothing
''rest of sub clipped
End Sub
The error occurs at the first attempt to set the array element to a
PlotConfigurations object. That is, the line "arrCase(0) =
objDbxDoc.CopyObjects(...)".
I can't figure out which argument is missing?
TIA
Adam Wuellner
Civiltech Engineering, Inc.