Blocks.Add method
Posted: Thu Oct 20, 2005 1:28 pm
I am trying to create a Block in Cadopia 6 Pro.
Here is the stripped down code I am using:
Dim CurrentDwg As Document
Dim TempBlock As IntelliCAD.Block
Dim InsertPoint As IntelliCAD.Point
Set CurrentDwg = Application.ActiveDocument
Set InsertPoint = Library.CreatePoint(0, 0, 0)
Set TempBlock = CurrentDwg.Blocks.Add(InsertPoint, "FOOBAR")
The last line produces the following error message:
Run-time error '-2147467259(80004005)':
Method 'Add' of Object "IIcadBlocks' failed
(Whew! That's a great error number!)
I have also tried this:
Set TempBlock = IntelliCAD.Blocks.Add(InsertPoint, "FOOBAR")
Same error.
This sure looks like the same sort of code in the Developer's
Reference.
Can someone show me the error of my ways?
Thanks in advance.
Here is the stripped down code I am using:
Dim CurrentDwg As Document
Dim TempBlock As IntelliCAD.Block
Dim InsertPoint As IntelliCAD.Point
Set CurrentDwg = Application.ActiveDocument
Set InsertPoint = Library.CreatePoint(0, 0, 0)
Set TempBlock = CurrentDwg.Blocks.Add(InsertPoint, "FOOBAR")
The last line produces the following error message:
Run-time error '-2147467259(80004005)':
Method 'Add' of Object "IIcadBlocks' failed
(Whew! That's a great error number!)
I have also tried this:
Set TempBlock = IntelliCAD.Blocks.Add(InsertPoint, "FOOBAR")
Same error.
This sure looks like the same sort of code in the Developer's
Reference.
Can someone show me the error of my ways?
Thanks in advance.