Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert external drawing as block using AutoCAD VBA
#1
use below code to insert a different drawing file as block inside a cad drawing - using AutoCAD VBA

Sub CAAinsertblock()
  Dim FileToInsert As String
  Dim BlockRef14 As AcadBlockReference
  Dim insertionPnt4(0 To 2) As Double
  insertionPnt4(0) = DRGX#: insertionPnt4(1) = DRGY#: insertionPnt4(2) = 0#
  FileToInsert = "C:\DWG\CAA\file-to-be-inserted.dwg"
  Set BlockRef14 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt4, FileToInsert, 1#, 1#, 1#, 0)
  'ZoomAll
End Sub
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)