Select Another Drawing To Copy To

Select Another Drawing To Copy To

Anonymous
Not applicable
295 Views
1 Reply
Message 1 of 2

Select Another Drawing To Copy To

Anonymous
Not applicable
I am totally new to this, I am trying to manipulate data from an open drawing and then copy it to a new template.

Is there a way of modifying this line of code to select a template ?

Set oDocB = ThisDrawing.Application.Documents("Test 1.dwg")

Thanks for your help
0 Likes
296 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
This code will make a new drawing by the template you specify "F:/mytemplate" then make it the current drawing. You can add your object maniputation commands before and after as you see fit.
ThisDrawing.Application.Documents.Add ("F:/mytemplate")
ThisDrawing.SaveAs ("f:/mydrawing")
dwgFileNew = ThisDrawing.Application.ActiveDocument.GetVariable("dwgname")

'make New dwg active
For Each drawing In ThisDrawing.Application.Documents
If drawing.Name = dwgFileNew Then
drawing.Activate
'MsgBox "Drawing " & drawing.Name & " is active."
End If
Next drawing
ThisDrawing.ActiveSpace = acModelSpace
0 Likes