Author Topic: insert a layout from another drawing  (Read 1894 times)

0 Members and 1 Guest are viewing this topic.

Humbertogo

  • Guest
insert a layout from another drawing
« on: April 25, 2007, 07:15:06 AM »
How can i insert a layout from another drawing like its happing in the desingcenter?

Bryco

  • Water Moccasin
  • Posts: 1883
Re: insert a layout from another drawing
« Reply #1 on: April 25, 2007, 11:05:20 AM »
I don't remember where I got this.
Code: [Select]
Public Function CopyLayout(Source As AcadLayout, TargetName As String) As AcadLayout

    Dim Doc As AcadDocument, Layout As AcadLayout
    Dim objArray() As Object, i As Integer

    Set Doc = Source.Document
    Set Layout = Doc.Layouts.Add(TargetName)

    If Source.Block.count > 0 Then

        ReDim objArray(0 To Source.Block.count - 1)

        For i = 0 To Source.Block.count - 1
            Set objArray(i) = Source.Block.Item(i)
        Next

        Doc.CopyObjects objArray, Layout.Block

    End If

    Layout.CopyFrom Source

    Set CopyLayout = Layout

End Function

Humbertogo

  • Guest
Re: insert a layout from another drawing
« Reply #2 on: April 26, 2007, 03:29:42 AM »
thanks again