Accessing linked CAD geometry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using a function to access the geometry of linked CAD files. Then function accepts an import instance as an argument and returns a list of geometry objects contained within the linked file. The function works great in Revit 2015 but I get an error in Revit 2014. It appears that the GetInstanceGeometry method does not return anything. I've tried using GetSymbolGeometry but that didn't work either. Any ideas why this works in 2015 but not in 2014? Here's the function:
Function GetLinkedDWGCurves(curLink As ImportInstance) As List(Of Geometryobject)
'returns list of curves for linked DWG file
Dim curveList As New List(Of GeometryObject)
Dim curOptions As New Options
Dim geoElement As GeometryElement
Dim geoInstance As GeometryInstance
'get geometry from current link
geoElement = curLink.Geometry(curOptions)
For Each geoObject As GeometryObject In geoElement
'convert geoObject to geometry instance
geoInstance = DirectCast(geoObject, GeometryInstance)
'loop through geometry objects in the geometry instance
For Each curObj As GeometryObject In geoInstance.GetInstanceGeometry()
'add object to list
curveList.Add(curObj)
Next
Next
'return list of geometry
Return curveList
End Function