Message 1 of 11
Insertion point not at 0,0

Not applicable
10-26-2003
12:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I wrote the following code to update the blocks in multiple drawings from a template drawing:
The program seemed to work OK but if you then try and insert the updated drawing into a new drawing manually or programatically the insertion point is not from 0,0 as the original drawing was.
The program basically works by opening a template, inserting the drawing to be updated, exploding the resulting block and then saving as the drawing that was inserted. It should be a simple, straightforward process but I can't figure out why it is doing what it is.
Regards - Nathan
Option Explicit
Option Compare Text
Public Sub Update()
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim objFile As Scripting.File
Dim objBlockRef As AcadBlockReference
Dim dblInsPt(2) As Double
Dim varInsPt As Variant
dblInsPt(0) = 0
dblInsPt(1) = 0
dblInsPt(2) = 0
varInsPt = dblInsPt
Set objFSO = New Scripting.FileSystemObject
Set objFolder = objFSO.GetFolder("Z:\Products\EXTERNAL\Limestone Coast Tourism\Atlas\BatchUpdate")
For Each objFile In objFolder.Files
If objFile.Name Like "*.dwg" = True Then
ThisDrawing.New "Z:\Products\EXTERNAL\Limestone Coast Tourism\Atlas\Page-Blocks.dwt"
Set objBlockRef = ThisDrawing.ModelSpace.InsertBlock(varInsPt, objFile.Path, 1, 1, 1, 0)
objBlockRef.Explode
objBlockRef.Delete
Application.ZoomExtents
ThisDrawing.PurgeAll
ThisDrawing.SaveAs objFile.Path, ac2004_dwg
End If
Next objFile
ThisDrawing.New "Z:\RAA_UTIL04\Batch.dwt"
End Sub
The program seemed to work OK but if you then try and insert the updated drawing into a new drawing manually or programatically the insertion point is not from 0,0 as the original drawing was.
The program basically works by opening a template, inserting the drawing to be updated, exploding the resulting block and then saving as the drawing that was inserted. It should be a simple, straightforward process but I can't figure out why it is doing what it is.
Regards - Nathan