Hi Kerry,
Over time, we will move all of the ADN knowledgebase to the blog. However, that's several thousand articles that we have to migrate to support our 2013 products at the same time - so that will be a slow process :-).
Cheers,
Stephen
Hi Kerry,
Over time, we will move all of the ADN knowledgebase to the blog. However, that's several thousand articles that we have to migrate to support our 2013 products at the same time - so that will be a slow process :-).
Cheers,
Stephen
Hi Kerry,Awesome!!!
Over time, we will move all of the ADN knowledgebase to the blog. However, that's several thousand articles that we have to migrate to support our 2013 products at the same time - so that will be a slow process :)
Cheers,
Stephen
< .. >
Awesome!!!
Thanks for the news.
So i guess this means ADN members will be getting a partial refund. :D
Sweet!
Thought some of you might like to bookmark this - http://adndevblog.typepad.com/autocad.
Cheers,
Stephen Preston
Autoesk Developer Network
Thought some of you might like to bookmark this - http://adndevblog.typepad.com/autocad.
Cheers,
Stephen Preston
Autoesk Developer Network
I think your readers
could really do without the line numbers in code, which prevents them
from copying/pasting it into an IDE.
I think your readers
could really do without the line numbers in code, which prevents them
from copying/pasting it into an IDE.
That charge could be leveled at this forum too, and it's a minor inconvenience at that (think ALT-SHIFT-Arrow (http://www.microsoft.com/download/en/search.aspx?q=Visual%20Studio%202010%20Keybinding%20Posters)). On the other hand, a reference to a line number can be handy in case someone is actually commenting on a piece of code.
That charge could be leveled at this forum too, and it's a minor inconvenience at that (think ALT-SHIFT-Arrow (http://www.microsoft.com/download/en/search.aspx?q=Visual%20Studio%202010%20Keybinding%20Posters)). On the other hand, a reference to a line number can be handy in case someone is actually commenting on a piece of code.
(defun c:helloworld ( )
(princ "\nHello World!")
)
That charge could be leveled at this forum too, and it's a minor inconvenience at that (think ALT-SHIFT-Arrow (http://www.microsoft.com/download/en/search.aspx?q=Visual%20Studio%202010%20Keybinding%20Posters)). On the other hand, a reference to a line number can be handy in case someone is actually commenting on a piece of code.
FYI, you can forgo line numbers and colour formatting by omitting the language tag from the bbcode code tags, i.e.:
[code]
(defun c:helloworld ( )
(princ "\nHello World!")
)
[/code]
Will produce:Code: [Select](defun c:helloworld ( )
(princ "\nHello World!")
)
( Just in case you weren't aware )
That charge could be leveled at this forum too, and it's a minor inconvenience at that (think ALT-SHIFT-Arrow (http://www.microsoft.com/download/en/search.aspx?q=Visual%20Studio%202010%20Keybinding%20Posters)). On the other hand, a reference to a line number can be handy in case someone is actually commenting on a piece of code.
FYI, you can forgo line numbers and colour formatting by omitting the language tag from the bbcode code tags, i.e.:
[code]
(defun c:helloworld ( )
(princ "\nHello World!")
)
[/code]
Will produce:Code: [Select](defun c:helloworld ( )
(princ "\nHello World!")
)
( Just in case you weren't aware )
My comments were regarding the AutoCAD DevBlog, since there is
no way to copy the code without getting the line numbers.
I was asked a question today I couldn't answer.
'Why didn't they do this 5 years ago ??'
I was asked a question today I couldn't answer.
'Why didn't they do this 5 years ago ??'
They did, it was called ADN. Which until now was the good ol' boys club. Now they seem to be opening up to those of us not in ADN.
Why don't they post examples for the vertical products (other than C3D) now?
For anyone who isn't already visiting the blog regularly ..... it's becoming a good resource and well worth a regular visit. (or subscribing to a feed :) )
Getting field code from field object
Below code shows the procedure to get the field code from text object. Code first checks whether field object is associated with text object or not using API “HasFields”. Then, uses “GetField” API of Mtext object to get the field object and shows the field code using API “GetFieldCode”.Code - C#: [Select]
[CommandMethod("GetFieldcode")] public void GetFieldcode() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; PromptEntityOptions options = options.SetRejectMessage("\nSelect Mtext object"); PromptEntityResult acSSPrompt = ed.GetEntity(options); if (acSSPrompt.Status != PromptStatus.OK) return; using (Transaction Tx = db.TransactionManager.StartTransaction()) { //get the mleader MText mtext = Tx.GetObject(acSSPrompt.ObjectId, OpenMode.ForRead) as MText; if (!mtext.HasFields) { ed.WriteMessage("\nObject does not contain fields."); return; } ObjectId id = mtext.GetField("TEXT"); Field field = Tx.GetObject(id, OpenMode.ForRead) as Field; string fldCode = field.GetFieldCode(FieldCodeFlags.AddMarkers | FieldCodeFlags.FieldCode); ed.WriteMessage("\nField code: " + fldCode); Tx.Commit(); } }
As I learn more and more about development in .NET, I am repeatedly reminded why I love coding in LISP:
...
As I learn more and more about development in .NET, I am repeatedly reminded why I love coding in LISP:
...
I used to feel that way when realizing how much more code it takes to get anything done in .NET vs. Lisp,
but then I came to learn how much more you can do in .NET and how elegant you can make things... and also that DCL is garbage for making a descent UI!
.... (search for GetObjects<T> in this forum for instance)....
.... (search for GetObjects<T> in this forum for instance)....
Hmmmm.
I just did that. Searching for GetObjects<T> produces no results.
Searching for 'GetObjects' (without the "<T>"), returns only your post containing the above quote. :s
Searching from within any board or child-board only returns hits from those boards and its children. To search the entire swamp forum, you have to search from the main page.
Searching from the main page using GetObjects returns about 20 hits.
There is no .NET API for it, but a COM API that can be used from .NET with AcSelect mode as acSelectionSetCrossingPolygon. The following sample function demonstrate it, and after an example of how use it. This code uses Late Binding, so you can use on your .NET code without need to reference Interop assemblies.Code - vb.net: [Select]
Public Shared Function selectCrossing(ByVal pline As Polyline, _ ByVal entitiesNames As String) _ As ObjectIdCollection 'This method was designed using COM/ActiveX API, but all types 'were replaced with Object, which means we're using Late Binding. 'Therefore no Interop references are needed 'AcadApplication Dim acadApp As Object = Application.AcadApplication 'AcadDocument Dim acadDoc As Object = acadApp.ActiveDocument Dim ssetObj As Object Dim pointsArray(0) As Double Dim grpCode(0) As Integer Dim grpValue(0) As Object Dim mode As Integer 'this selection only works with entities visible on the screen, 'so we need to extend to make sure everything is visible 'acadApp.ZoomExtends() 'acadApp.Update() ReDim pointsArray(pline.NumberOfVertices * 3 - 1) For i As Integer = 0 To pline.NumberOfVertices - 1 Dim vertice As Point3d = pline.GetPoint3dAt(i) pointsArray(i * 3 + 0) = vertice.X pointsArray(i * 3 + 1) = vertice.Y pointsArray(i * 3 + 2) = vertice.Z Next 'will store the entities inside the region Dim objIdColl As New ObjectIdCollection ssetObj = acadDoc.SelectionSets.Add("TEMPSELSET1") ssetObj.Clear() Dim gpCode As Int16() ReDim gpCode(1) gpCode(0) = 0 gpCode(1) = 10 Dim dataValue As Object() ReDim dataValue(0) dataValue(0) = entitiesNames Dim groupCode As Object, dataCode As Object groupCode = gpCode dataCode = dataValue 'these modes are definied under 'Autodesk.AutoCAD.Interop.Common.AcSelect 'but again we're not using explicit Interop references mode = 7 'AcSelect.acSelectionSetCrossingPolygon ssetObj.SelectByPolygon(mode, pointsArray, groupCode, dataCode) ' if one or more point entities in the selection area If ssetObj.count >= 1 Then For Each ent In ssetObj objIdColl.Add(New ObjectId(New IntPtr(CLng(ent.ObjectID)))) Next ent End If ssetObj.Delete() 'delete the temp selection set 'acadApp.ZoomPrevious() 'restore the zoom Return objIdColl End Function
Someone removed my comment, and unfortunately, he forgot one thing: also removing the post altogetherNow it looks like he remembered
My comment hasn't been censored.Now it has.
Maybe they (Autodesk guys) didn't see it was ironical >:D
Recently, Stephen posted this great blog entry on Performance – perception versus reality and then asked me if I could tell you all the tricks I have learnt over the years to produce the fastest, leanest AutoCAD code on the planet !!