Author Topic: Civil3D 2014 Gotcha  (Read 1729 times)

0 Members and 1 Guest are viewing this topic.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Civil3D 2014 Gotcha
« on: July 18, 2013, 07:19:43 PM »
SincpacC3D has had code to transfer styles between drawings (Import/Export) since C3D2010SP1. It has worked quite well with every version, until now. Last week I had a number of support calls regarding the ImportStyles only bringing in 1 or 2 styles at a time and the user would have to close C3D in order to get another 1 or 2. This is obviously not how it was designed to work, nor how it has worked for going on 5 years. I spent quite some time trying to Debug this and finally submitted a support request with Autodesk. A few days later, I get the response that it is working correctly, could I please provide code showing how it doesn't work. Well, it is interlaced with all kinds of our internal classes that just didn't make sense to try to give them everything, so I spent some time writing some sample code to demonstrate the issue. Of course, it all worked fine, no issues to duplicate. I stepped away for a few days and kept asking "How in the heck is the Sincpac code different than my example code?". I mean, I had it down to making sure that the ObjectIdCollection in my test and the shipping code were identical, yet the test worked and the shipping code did not. After 3 days of beating my head against the wall, it dawned on me that due to a few things we do in the background, the shipping code has a Transaction inside of which the StyleBase.ExportTo() method was being called. My test code had no such transaction...so I added one...the test code was now broke, too!

Yippee!  After some refactoring to get that part of the transfer styles code out of the Transaction(s), the SincpacC3D code is once again working like it should. So if you are using that method, and it seems to have quit working, it's likely that it is being called within a Transaction, and Civil3D 2014's implementation of this method does not like that.   :ugly:

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Civil3D 2014 Gotcha
« Reply #1 on: July 19, 2013, 01:23:36 PM »
Follow up to this. Evidently this only applies to Importing styles into the current drawing. When Exporting to another database I am having some major issues that have crashed my PC a few times now.