ObjectDBX Replace Layout Tabs with ones from New Drawing (VBA / LISP)

ObjectDBX Replace Layout Tabs with ones from New Drawing (VBA / LISP)

Anonymous
Not applicable
440 Views
0 Replies
Message 1 of 1

ObjectDBX Replace Layout Tabs with ones from New Drawing (VBA / LISP)

Anonymous
Not applicable

- Background: I wrote a VBA code to setup new projects. The code creates dummy files that include layout tabs, blocks and xrefs. Inevitably the project changes and adjustments need to be made. I have a file called XX_template_XX.dwg that includes the new layouts that I will use to update the existing file(s).

 

The believe the solution I am looking for involves using the ObjectDBX utility and goes something like this as I dont have experience using this utility:

 

Private ReplaceLayouts_Click()
    Dim oDBX
    Dim newLayout, newBlock
    Dim oldLayout, oldBlock
    Dim strFileName As String

'open template and copy layouts?
    strFileName = "Q:\Project\XX_Template_XX.dwg"
    'open strFileName
    'copy layouts using ObjectDBX utility
        Set oDBX = GetInterfaceObject("ObjectDBX.AxDbDocument.19")
        Set newLayout = ThisDrawing.Layouts.Add("New Layout")
        Set newBlock = newLayout.Block
        ThisDrawing.CopyObjects newBlock, newLayout
'close template

'open file (that has old layouts) and re-place with new layouts
    'delete Layouts
    'paste Layouts
        ThisDrawing.PasteObjects newBlock, newLayout
'close file
    
End Sub

 

As you can see I have no idea what i am doing. please help or forward me a link that will help me learn how to run this function.

 

Thank You!

 -K

0 Likes
441 Views
0 Replies
Replies (0)