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

Automatic Oracle DB layers updating

1 REPLY 1
Reply
Message 1 of 2
gisstat
246 Views, 1 Reply

Automatic Oracle DB layers updating

Hello.
In Civil 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?

1 REPLY 1
Message 2 of 2
Murph_Map
in reply to: gisstat

You may want to post here to get an answer.

Murph
Supporting the troops daily.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report