StartTransaction() has a huge overhead for small operations – about 100 times slower that Open and Close style for entity read operations totaling less than about 80 in a single transaction. StartOpenCloseTransaction() can be easily substituted for StartTransaction() calls, thus regaining your performance while maintaining the same code layout. I should mention that StartTransaction() really comes into it’s own on large datasets, quickly becoming 1000+ times quicker than Open and Close for write operations
This should work just draw a line then run command and the start point should move to the orgin.
Code - C#: [Select]
[CommandMethod("OpenLine")] public void OpenLine() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; Line line = ed.GetEntity("Get Line").ObjectId.Open(OpenMode.ForWrite) as Line; line.StartPoint = Point3d.Origin; line.Close(); }
Yes you can still use it all that means is they added a Obsolete Attribute.
It would be nice if they added comments like this from here (http://adndevblog.typepad.com/autocad/2012/06/creating-a-polyline3d-without-using-transactions.html) to the documentationQuote
StartTransaction() has a huge overhead for small operations – about 100 times slower that Open and Close style for entity read operations totaling less than about 80 in a single transaction. StartOpenCloseTransaction() can be easily substituted for StartTransaction() calls, thus regaining your performance while maintaining the same code layout. I should mention that StartTransaction() really comes into it’s own on large datasets, quickly becoming 1000+ times quicker than Open and Close for write operations
[Obsolete]
[CommandMethod("OpenLine")]
public void OpenLine()
{
< ..... >
}
Needed a fix.
It would be nice if theyadded comments like this fromhere(http://adndevblog.typepad.com/autocad/2012/06/creating-a-polyline3d-without-using-transactions.html) had Tony T do the documentation
First, the overhead of 'small operations' is generally insignificant and not perceptible to a user. In other words, the fact that AcTransaction is 100 times slower than the open/close mechanism with 80 operations means little or nothing because that takes a fraction of a second either way.
It would be nice if they added comments like this from here to the documentation
[Obsolete("For advanced use only. Use GetObject instead")]
public DBObject Open(OpenMode mode);
some people suggested that I just liked to whinge and that real programmers don't need documentation anyway.That can talk or only those, who have never written code, or the stupid people. :( The judgement of such people has no significance.
< .. >
2 Kerry
I can't to translate "poofteenth" word. Have you misprint?
< .. >