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

COGO creation Fatal exception !!

5 REPLIES 5
Reply
Message 1 of 6
raghulan
369 Views, 5 Replies

COGO creation Fatal exception !!

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();
                }
            }

 

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
5 REPLIES 5
Message 2 of 6
raghulan
in reply to: raghulan

Any expert advice on this.!!!
Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 3 of 6
Partha.Sarkar
in reply to: raghulan

Hi Raghu,

 

You need to give us a reproduce-able steps and associated DWG (if any) to investigate further.

 

Thanks,

 



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 4 of 6
raghulan
in reply to: Partha.Sarkar

Thanks Partha,

Will send you that shortly.
Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 5 of 6
raghulan
in reply to: raghulan

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.!

 

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 6 of 6
raghulan
in reply to: raghulan

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...

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report