Author Topic: .NET Help  (Read 29363 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: .NET Help
« Reply #60 on: March 07, 2008, 08:59:27 PM »
...but rather how Autodesk decided to layer a managed code layer on top of their COM layer via Interop. A proper .NET API wouldn't require such ugly casts...

This is not a correct statement. The .NET API wraps Native ObjectARX/C++ code

PS there really is never a need to “Wrap” a com API., as the .NET compiler will create Runtime Callable Wrappers (RCW) 

« Last Edit: March 07, 2008, 09:06:35 PM by Daniel »

StefanDidak

  • Guest
Re: .NET Help
« Reply #61 on: March 07, 2008, 09:07:08 PM »
...but rather how Autodesk decided to layer a managed code layer on top of their COM layer via Interop. A proper .NET API wouldn't require such ugly casts...
This is not a correct statement. The .NET API wraps Native ObjectARX/C++ code
Then it's still an awful job from an architecture perspective!  :-D
It's just a total mishmash of (inconsistent) layers in order to expose internal functionality to a third party outside world (instead of engineering an actual API for both internal and external use). For example, just look at how for an average C3D addon you generally need to (from managed code, that is) interact with the .NET API and the COM objects for Land/Map, etc.

tjr

  • Guest
Re: .NET Help
« Reply #62 on: March 07, 2008, 09:09:17 PM »
<snip>
Fourth item: Are you implying professionals use languages that have braces and semicolons and novices use VB?
<snip>

I didn't say or imply unprofessionalism. I said it looks a mess (to me).



<snip>
Like I said before I am speaking from my own experiences with C#. I found it to be a horrid language and I wouldn't recommend it to anyone.

Yes, I got that .. I was looking for your rationale.
Your response to the first item was my answer to your second item, I've used it, I don't like it and I wouldn't recommend it.

It's funny the way this whole thread ended up the way it did. If this topic had been in the Lagniappe section and had been about something like toast toppings I highly doubt I would be on the brink of bringing the "Australian" out of someone for saying creamy peanut butter is horrid and that I prefer crunchy. I guess it all depends on what you're passionate about.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: .NET Help
« Reply #63 on: March 07, 2008, 09:27:06 PM »
Then it's still an awful job from an architecture perspective!  :-D

I have to disagree, while the .NET api for Autocad might have its flaws here and there,
It’s very well written. (i.e. no mishmash ) … just my opinion though.  :-)

StefanDidak

  • Guest
Re: .NET Help
« Reply #64 on: March 07, 2008, 09:36:59 PM »
Then it's still an awful job from an architecture perspective!  :-D
I have to disagree, while the .NET api for Autocad might have its flaws here and there,
It’s very well written. (i.e. no mishmash ) … just my opinion though.  :-)
OK, that's it! You're going to have to report to the nearest GAC (good architecture center) where I will personally expose you for 48 hours to dozens of well designed API's and download 22 years of development experience into you via the new neural interface. Whooaaahahhaa (insert evil sound track here). Oh, wait, I'll have to adjust the release forms and disclaimers to exclude PTDD (post-traumatic development disorder).  :-D

Actually, the .NET API for ACAD all on its own doesn't present such a mishmash, you're right, that's only when you get into the verticals. But from dealing with SDK's and API's in the past 22 years I do have to say it's been close to the worst I've seen (there's one I worked with that was even worse, a $25.000 SDK license for a product that shall remain nameless where the docs shipped onto 17 badly photocopied sheets of paper).

Josh Nieman

  • Guest
Re: .NET Help
« Reply #65 on: March 07, 2008, 10:01:56 PM »
Thank you very much for sticking to your guns TJR.  It's good to see coherant and backed-up statements from BOTH sides, and yes, as you guessed, you're not alone... I'm very much like you in regards to learning style.  I'm trying to bite the bullet on this one, because I've heard from many who share similar learning styles as we do, who've said they should have just done it the step-by-step way by the book in the first place as it would have saved them time.  CmdrDuh seems to be one as well.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: .NET Help
« Reply #66 on: March 07, 2008, 10:14:41 PM »
Josh, I went back to your original post.

<snip>    most of what I see is people already experienced, already knowledgable, already with a good foundation of knowledge of programming   <snip>
Any help for the newb?

The answer quite simply is to study and become knowledgable ... either by hard earned experience or by standing on the shoulders of those who have been here before us.
There is no magic pill for this one.
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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: .NET Help
« Reply #67 on: March 07, 2008, 10:21:31 PM »
The answer quite simply is to study and become knowledgeable ... either by hard earned experience or by standing on the shoulders of those who have been here before us ...

... (well said) and when you've time, energy and interest do learn more than one language: A good mechanic keeps more than a single vice grip in his toolbox.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

Glenn R

  • Guest
Re: .NET Help
« Reply #68 on: March 08, 2008, 04:46:43 AM »
This turned into an interesting discussion - thanks to all.

Tim,

I have actually been toying with the idea of looking at IronPython as a lot of people here seem to taking an interest in python in general, however the lack of braces just really throws me when looking at example code...I just can't seem to delineate where things start and end.

I know a little study on the matter would alleviate this though and am willing to try it eventually.

Cheers,
Glenn.

Glenn R

  • Guest
Re: .NET Help
« Reply #69 on: March 08, 2008, 04:47:54 AM »
... for saying creamy peanut butter is horrid and that I prefer crunchy. I guess it all depends on what you're passionate about.

Prefer crunchy myself as well ;)

Glenn R

  • Guest
Re: .NET Help
« Reply #70 on: March 08, 2008, 05:18:10 AM »
Probably old news to some: IronPythonStudio

tjr

  • Guest
Re: .NET Help
« Reply #71 on: March 08, 2008, 09:40:39 AM »
This turned into an interesting discussion - thanks to all.

Tim,

I have actually been toying with the idea of looking at IronPython as a lot of people here seem to taking an interest in python in general, however the lack of braces just really throws me when looking at example code...I just can't seem to delineate where things start and end.

I know a little study on the matter would alleviate this though and am willing to try it eventually.

Cheers,
Glenn.
The biggest complaint people have when they start out with Python is the fact that code blocks are controlled by white spaces instead of braces. However once you use it a while it you will come to realize that it forces you to write readable code.

Here is a little IronPython script I wrote to quickly view a XML config file we have for our batch plotting program. I find it very easy to follow.
Code: [Select]
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
clr.AddReference('System.Data')

from System.Windows.Forms import (
    Form, Panel, Label,
    TextBox, DockStyle, Button,
    ScrollBars, Application, DataGridView,
    DataGridViewColumnHeadersHeightSizeMode,
    MessageBox, MessageBoxButtons,
    MessageBoxIcon
)

from System.Drawing import (
    Point, Size
)

from System.Data import DataSet


class PlotConfigForm(Form):

        def __init__(self):
            self.Text = 'Batch Plot Config Viewer'
            self.ClientSize = Size(1050, 650)
            self.MinimumSize = Size(500, 200)
            self.ds = DataSet()
            self.ds.ReadXml('ERM Batch Plot Configurations.xml')
           
            self.setupDataGridView()
       
       
        def setupDataGridView(self):           
            self._dataGridView1 = DataGridView()
            self._dataGridView1.AllowUserToOrderColumns = True
            self._dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
            self._dataGridView1.Dock = DockStyle.Fill
            self._dataGridView1.Location = Point(0, 111)
            self._dataGridView1.Size = Size(506, 273)
            self._dataGridView1.TabIndex = 3
            self._dataGridView1.DataSource = self.ds.Tables[0]
           
            self.Controls.Add(self._dataGridView1)
       
       
       


Application.Run(PlotConfigForm())

Josh Nieman

  • Guest
Re: .NET Help
« Reply #72 on: March 08, 2008, 03:31:38 PM »
I wasn't looking for a magic pill, just more some help to find a good PRODUCTIVE path to start myself on.

I've begun the "Quick Start" tutorials that came with the Microsoft Visual C# Express Edition, beginning with the "Create Your First Application" guide.  I like the interface, thoroughness, and ease of following the tutorial.  It explains things well, it keeps it simple, and I found I was able to go through them quite easily.

I'm still getting used to the interface between the Form/Design, and Code and how to get to the specific code for each item from the toolbox you put into the form, but it is very nice.  I was used to the VB editor in Autocad, is all.  This, however is cool... and wow... SO SO SO much more to do and so much more flexibility than I had seen before this.

Exciting things are sure to follow.

Thank you all for the numerous replies, insights, tips, opinions, and guidance.  You're all quite the invaluable resource.  I only wish I had more to offer in return.

Glenn R

  • Guest
Re: .NET Help
« Reply #73 on: March 08, 2008, 03:53:10 PM »
You'll get there Josh - just give it some time...walk before you can run grasshopper.

This would be very informative and it's video - the MSDN webcasts are actually very, very good:

Visual C# Soup to Nuts

Cheers,
Glenn.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: .NET Help
« Reply #74 on: March 08, 2008, 04:01:45 PM »
Wow, there's a lot there; thanks Glenn.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst