Hello All,
Here is what I am trying to do,
I am working on an application, where the user would would choose
Category of point
Sub-category of point
Then click on a Button
1. Which then querry SQLite DB based on the querry a COGO point with relevent RDesc in inserted.
2. A suitable block is inserted in the same location.
3. Updates the handle for the block to the COGO UDP
Now I have commeted the last part of updating UDP.
I have issue inserting COGO.
Sometimes it works some time it throws fatal exception, object instance is not set. I am unable to catch the fatal exception.
Mini Dump - The thread tried to read from or write to a virtual address for which it does not have the appropriate access
Here is the code,
Global.variables.spt_current_COGO_pt = null; PromptPointOptions ppo = new PromptPointOptions("\nSelect the location to Create a Smart Point : "); PromptPointResult ppr = Global.variables.ed.GetPoint(ppo); if (ppr.Status != PromptStatus.OK) return false; Point3d pt_loc = ppr.Value; //start Transaction using (Transaction tr = db.TransactionManager.StartTransaction()) { try { // All points in a document are held in a CogoPointCollection object // We can access CogoPointCollection through the CivilDocument.CogoPoints property CogoPointCollection cogo_pt_coll = CivilApplication.ActiveDocument.CogoPoints; ObjectId pt_id = cogo_pt_coll.Add(pt_loc); CogoPoint spt_current_COGO_pt = pt_id.GetObject(Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite) as CogoPoint; } catch (CivilException cex) { Helper.Logger.SPT_log_it("COGO Creation Error (cex) : " + cex.ToString()); } tr.Commit(); } }
Hi Raghu,
You need to give us a reproduce-able steps and associated DWG (if any) to investigate further.
Thanks,
Partha,
I fixed the issue!..
The problem was
When I tried to create a COGO and add infromation.
I tried to do all of them within one transaction.
After I split that into two transactions it worked fine.
Thanks for your respoense.!
Partha,
Eventhough the issue is fixed.
I have another problem, when I run the command and create few COGO points.
After which if I do UNDO and try to create objects again..it gives me fatal error.
How do I fix this issue.
should I turn of UNDo during the command.
or anythign ideas...