Author Topic: DevTV: Introductory recordings on Autodesk APIs  (Read 18230 times)

0 Members and 1 Guest are viewing this topic.

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #30 on: November 16, 2007, 12:42:44 AM »
All that VB nastiness!

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #31 on: November 16, 2007, 12:43:21 AM »
Give this a whirl Kerry.

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #32 on: November 16, 2007, 12:54:32 AM »
Just thought I should post the solution as well because of the UserControl.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #33 on: November 16, 2007, 01:57:52 AM »

I've just had one of 'those' thoughts ...
I wonder if doing the translation from VB to C# with Lutz Roeder's Reflector would be more efficient and accurate than using SharpDevelop ??

[addToListOfThingsToTest]
Do not know what of the demos you guys are using.... I download the first one on the list and opened on visual studio 2005, removed the debug to a2008, did the compile and open it using lutz reflector and getting something like:

Code: [Select]
[CommandMethod("addAnEnt")]
public void AddAnEnt()
{
 ///............
}

All that VB nastiness!


I tried the same Luis ... hardly ' pretty ' sample code, is it  :-)


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #34 on: November 16, 2007, 02:02:59 AM »
Just thought I should post the solution as well because of the UserControl.
DevTvIntroCS.zip (52.73 KB - downloaded 2 times.)

Thanks Glenn .. I'll have a look tonight when by head cools down.



....
Just a matter of style, what to you guys think about the comments preceding each code line ?
.. I 'spose it depends on your comfort level with the code ...
« Last Edit: November 16, 2007, 02:05:00 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #35 on: November 16, 2007, 02:59:37 AM »
...er...that's it's a comment...?
What do you mean?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #36 on: November 16, 2007, 04:19:01 AM »

...er...that's it's a comment...?
What do you mean?

I found the quantity and regularity of comments in the original doc a little overpowering ...
 
In the editor I have turned the color of Comments to silver in the config so they're almost ignorable ..
.. but the comments tend to dominate in code posts and prints.

 I 'spose I'm forgetting that this is/was sample/Example code.

.. just ignore me.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #37 on: November 16, 2007, 10:59:23 AM »
Just thought I should post the solution as well because of the UserControl.


Thanks, much better!


ps: why that sample was done using vb.net [if he started with c#]? [me like c#]
« Last Edit: November 16, 2007, 11:50:28 AM by LE »

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #38 on: November 16, 2007, 07:59:27 PM »
I've been turning mine to silver for years for the exact same reason...another reason I'm liking CopySourceAsHtml...preserves the colours as you've no doubt seen already.

Cheers,
Glenn.

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #39 on: November 16, 2007, 08:03:22 PM »
As far as comments go, I read something recently which made a lot of sense - don't comment the obvious. An example of this in reference to the code samples we're discussing, would be the comment about getting the editor object...too obvious, therefor I wouldn't do it.

I put in most of the comments (got tired of doing it for the last 2 function/commands as you can see) to preserve what was done in the video for other 'starters' if you will.

I resisted the urge mightilly too I might add to rewrite it - some sections are...'not best practice' shall we say. However, I did change the odd thing here and there, with one of the major ones being I declared the palette and paletteset variables as private and static.

Cheers,
Glenn.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #40 on: November 16, 2007, 08:14:35 PM »

Quote
.... I resisted the urge mightilly too I might add to rewrite it - some sections are...'not best practice' shall we say.


Some of that could be atttributed to the 'Conversion' , some possibly to the writer trying to keep the sample relatively simple.

This is the primary reason why I would have liked to see the sample as "professionally written" C# code 
..... it comes back to a long standing assertion of mine .. most people learn by osmosis ; show them/us enough less than optimal code and that standard  becomes the accepted norm.

Thanks Glenn,
regards, Kerry.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #41 on: November 16, 2007, 08:20:10 PM »
Some of that could be atttributed to the 'Conversion'

There was no conversion on my part - I wrote it from scratch. I tend to agree with your comment about the writer keeping it simple...it is afterall an introduction. I also agree that they should lead by example as it were.

Cheers,
Glenn.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #42 on: April 18, 2008, 10:23:47 AM »
I finally got around to watching part of this video.  I didn't download the source code, and now I'm glad I didn't.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

jjs

  • Guest
Re: DevTV: Introductory recordings on Autodesk APIs
« Reply #43 on: October 06, 2008, 11:50:04 AM »
This topic is old. Thought I might dust it off.