AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automatic Oracle DB layers updating

2 REPLIES 2
Reply
Message 1 of 3
gisstat
470 Views, 2 Replies

Automatic Oracle DB layers updating

Hello.
In Map 3D the data uses from Oracle by means of FDO connection. The system is oriented to cooperative work, so we Need to update changes made by all network users automatically.
If we use the code below and call it manually with the command, then, usually, everything works OK.
[CommandMethod("MANREFRESH")]
public void man_refresh()
{
AcMapMap currentMap = AcMapMap.GetCurrentMap();
MgLayerCollection LayerCol = currentMap.GetLayers();
for (int i = 0; i < LayerCol.Count; i++)
{
MgLayerBase currentLayer = LayerCol.GetItem(i);
currentLayer.ForceRefresh();
}
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Regen();
}
But if we run the same code from a dll by timer or by notification in socket, then we get the error:

>> System.NullReferenceException: Object reference not set to an instance of the object.

If we remove Regen (), we get a blank window witgout any objects after the update happens. In this case objects can be returned manually by right-clicking on Oracle layers and selecting "Update layer."
Do anyone know how could this issue be resolved? Or may there be any other ways to make layers refreshing?

2 REPLIES 2
Message 2 of 3
braudpat
in reply to: gisstat

 

Hello

 

I am not a programmer, so ...

 

If you want to update all the FDO layers, you could use the MAPUPDATEMAP command !

 

Bye, Pat

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 3 of 3
djonio
in reply to: gisstat

Howdy,

Version??

How/when is the dll that contains public void man_refresh() bing loaded? Initialize()?

"But if we run the same code from a dll by timer or by notification in socket, then we get the error:" Threading? From a windows form? Forms Timer or System Timer?

r,

dennis

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost