Autodesk.Map.IM.Display.GraphicsGeneration.GraphicsGeneratorFactory is obsolete!

By Partha Sarkar

If you are
trying to create an instance of IGraphicsGenerator in Map 3D 2013 from
GraphicsGeneratorFactory.Instance, you might see the following compiler error - 

Autodesk.Map.IM.Display.GraphicsGeneration.GraphicsGeneratorFactory'
is obsolete: 'No longer supported; the graphic generator is no longer a
singleton. It is a service instead, use
Application.Services.GetService<IGraphicsGenerator>().'
 

Public Shared
ReadOnly Property Instance As
Autodesk.Map.IM.Display.GraphicsGeneration.IGraphicsGenerator' is obsolete: 'No
longer supported; the graphic generator is no longer a singleton. It is a
service instead, use
Application.Services.GetService<IGraphicsGenerator>().

 

In Map 3D
2013 Industry Data Model API, you can access IGraphicsGenerator  like below :

Dim gg As IGraphicsGenerator = 
  Me.Application.Services.GetService(Of Autodesk.Map.IM.Display.GraphicsGeneration.IGraphicsGenerator)()
 
If gg Is Nothing Then
    Me.Application.MsgBox("Graphic generator is not registered.")
    Return
End If
 
Hope this is
useful to you!

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading