DrawingSet.Item method

AutoCAD Map 3D ActiveX

DrawingSet.Item method

Gets an attached drawing from a drawing set.

Item(AttachedDwg As Variant) As AttachedDrawing

Returns the attached drawing.

AttachedDwg

Either the index, starting at 0, of the drawing in the DrawingSet collection, or the full path and file name of the drawing in this form: alias or drive + path + filename.

The following example attaches two drawings to the drawing set, gets one of the items in the set by passing the alias, and gets the other item by passing the index of the drawing in the set.

Dim amap As AcadMap

Dim prj As Project

Dim drset As DrawingSet

Dim atdr As AttachedDrawing

Dim cDrset As Integer, i As Integer

 

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

Set drset = prj.DrawingSet

Set atdr = drset.Add("ALIASNAME:\\DirName\\DwgName1.dwg")

Set atdr = drset.Add("ALIASNAME:\\DirName\\DwgName2.dwg")

Set atdr = drset.Item("ALIASNAME:\\DirName\\DwgName2.dwg")

Debug.Print "Found "; atdr.AliasPath

 

cDrset = drset.Count

For i = 0 To cDrset - 1

Set atdr = drset.Item(i) 

If atdr.AliasPath = "ALIASNAME:\\DirName\\DwgName2.dwg" Then 

Debug.Print "Found " & "DwgName2.dwg" 

End If 

Next i