.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting started with Dot Net

48 REPLIES 48
Reply
Message 1 of 49
Somsekhar
1200 Views, 48 Replies

Getting started with Dot Net

Hi Folks,

I am quite new to AutoCAD development. I have been using AutoCAD for some time now but have not really done any development or customization. Since I am starting to look at the development .....thought of starting with Dot Net. Since, Dot Net is the future ...what say ..huh !!
I am not sure if I should start straight away without having a hands on with Lisp or Visual Lisp. Could someone please tell me if it is really necessary to go through Lisp, VBA, Visual Lisp to get started with Dot Net ...!!
And what is the best way to start with Dot Net in AutoCAD. What are the reference materials ? Is there is any kind of Getting Started Guide ?
Please guys ...I am getting confused.....

Thanks in anticipation.
Som
48 REPLIES 48
Message 21 of 49
Anonymous
in reply to: Somsekhar

No offense taken, Tony 😃

My main point was exactly what you said, "No, it doesn't 'appear to be
object oriented', unless one does not understand what object oriented
really is and means." I was speaking of cad users who want to learn
programming and they don't have any idea what oop is at all. They also
don't want to pay to learn, they just want their 3day crash course to go
make whatever it is they want to make.

My background is actually Fortran and I understand oop. Unfortunately, I've
spent the last 4 years building a national dev team to support a national
sales team and have had very little time to keep up with the inner workings
of the languages I use and no time for formal training. Its all otj and
mostly late night and I'm lucky to just get the jobs out the door. Point
being I understand and am not arguing your points.

I am guilty of being an ex-lisper - kinda like an ex-smoker 😃 If you're
going to try muddling through vlisp, just jump the fence and learn vb.
There's more future in it even if you never grasp the true essence of oop
than there is in lisp. Its only a matter of time before acad evolves into
an inventor or revit and autolisp/vlisp goes away - heck, you don't even
need a command prompt now which kinda reminds me of getting that free
Windows version of R13 that I really didn't need....or did I? 😃 But that's
another speculative thread there.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
Message 22 of 49
Anonymous
in reply to: Somsekhar

"Mike Tuersley" wrote

>> My main point was exactly what you said, "No, it doesn't 'appear to be
object oriented', unless one does not understand what object oriented
really is and means." I was speaking of cad users who want to learn
programming and they don't have any idea what oop is at all. They also
don't want to pay to learn, they just want their 3day crash course to go
make whatever it is they want to make. <<

Mike - As I see it, that's a large part of the problem.
One can't effectively use an object-oriented API like
the .NET framework, and the managed wrapper API for
ObjectARX, without having a reasonable understanding
of fundamental OOP concepts. If the framework one
is using is object-oriented, then one must have some
conceptual understanding of OOP in order to use the
framework.

That's how we arrive at solutions like the one I posted
for the palette activation event problem. Because we
understand object inheritance and how overridden virtual
methods can be used to alter the behavior of existing
objects, we know how to deal with that sort of problem.

Bug since that kind of solution is not even possible in
VB 'Classic', chances are good that even an expert VB6
programmer is not going to see that solution, and so
they tend to gravitate towards hacking and dangerous
kludges like subclassing.

I've been working with real OOP for at least 10 years,
and it's come to the point where I can't even use VB
Classic any more. Writing even a short sample program
that shows how to use a component developed in ARX,
is like Chinese water torture.

I consider myself lucky that I chose the Delphi path
long ago, and that's mainly because so much of the
.NET framework was actually modeled after and/or
inspired by Delphi and its VCL framework (the same
person that invented Delphi, also happens to be largely
responsible for significant parts of the .NET framework,
as well as the C# and J++ languages). Because of
that, transitioning from Delphi to .NET was like a walk
in the park.

Delphi itself is now a first-class .NET language, and I
can compile much of my existing Delphi code to .NET
managed code, or native Win32 code, with little to no
change.


AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
Message 23 of 49
Anonymous
in reply to: Somsekhar

Interesting....I always wanted to look into Delphi just never had the
chance, yet. And, for the record, my OOP skills are slightly under the
surface of the tip of the iceberg ;-)That's why I learn something from
almost all of your posts - even if its just another way to look at
something that I already know.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
Message 24 of 49
jbryant4
in reply to: Somsekhar

"A major advantage of any program language over the Autolisp environment is avoidance of DCL files which are useless or anything but interaction with Autolisp".......Interaction with AutoLISP? What alse would you need them for?...Your statement in more false than it is true, and is nothing more then personal preference......Creating and Coding DCL's are tedious, but in most cases do the job fine...You can make VBA forms much easier (and prettier) but typically the code "after the form is created" will be 2-3 times longer. Of course, this is only my opinion...Ever noticed how the VLISP Discussion Group has about 4 times the activity that the VBA group has?...Wonder if that is because VBA is so much easier?
Message 25 of 49
Anonymous
in reply to: Somsekhar

Som,

KrishnaK is right. Get to know the structure of the AutoCAD database. This
is foremost. Learn the capabilities and limitations of the languages
available. When confronted with a programming task, use your past experience
to select your language(s) based on the task at hand and the capabilities of
the language. In time your experience will grow. Try not to mix too many
languages together for a project.

I started with AutoLisp because that's all there was back then. VLisp gives
you an IDE and to me is the same thing as AutoLisp. AutoLisp offers a very,
very powerful way to manipulate the drawing database. You will find AutoLisp
can do things that other languages can't. If you are programming in AutoLisp
and need dialog boxes, use DCL. DCL was designed for AutoLisp. Don't
disregard it (as old fashioned as it appears).

VBA is cool. Form design just got alot easier. If you need to exchange
information between some other applications go with this. Try and explode a
hatch with it though.

I haven't had much experience with .NET Framework. I find it much like VBA.
More like VB. It's an exhastive collection of namespaces, classes,
properties and methods. Your biggest difficulty will be locating the correct
function to use.

Cheers,
Kenneth Hutson
San Antonio, TX
Message 26 of 49
Somsekhar
in reply to: Somsekhar

Thanks Krishna,
Your reply perhaps gives the right direction. I was really bewildered with the discussions/suggestions/arguments going in this group.
Shall start to understand the AutoCAD database first. And then get familiar with Object ARX. I have the .Net samples with me.
I think once I get to understand ARX, i can start with programming in .net for AutoCAD. What say ??
Thanks again.
Message 27 of 49
KrishnaK
in reply to: Somsekhar

Hi Somsekhar,
Like I said, you don't need to know ObjectARX to start learning .NET API although you would benefit from learning it. If you have the time, and if you know C++, then definitely look at the arxlabs folder and work out all the labs. It will be an uphill task at first, but you will surely appreciate it when you move on to the .NET API. You will realize later how easy it is to use the .NET API - yet getting the power of ObjectARX. Note: If you are planning on writing custom objects, it is possible only with C++. If you want to expose it to .NET, you will have to write a wrapper around it - for an example, check out "managed" project in polysamp (\samples\entity\polysamp).
Message 28 of 49
Anonymous
in reply to: Somsekhar

Somsekhar wrote:

> Shall start to understand the AutoCAD database first. And then get
> familiar with Object ARX.

That's not exactly the best way to proceed. You will come to understand
AutoCAD's mechanism's through the language you choose to use.

As for ObjectARX, it's C++ so there's not a whole lot of correlation
between it and sandbox languages like C# or VB.NET. ARX will only serve
to lengthen the learning curve so unless you intend to make it your
primary language, I'd skip it and move straight into C# or VB.NET.
Message 29 of 49
Anonymous
in reply to: Somsekhar

Hi Kenneth,

I cannot understand how you could advise anyone to waste time learning to
use DCL.

For someone who has been forced to use it because there was no alternative -
that's life.

But for someone who is looking to decide what language to program in, to
suggest that they should spend the hours/days necessary to setup their
first - second and third DCL forms is ludicrous. Maybe with a simple form
they could then get it down to an hour or two per form.

Lisp is powerful in its interaction with the AutoCAD drafting engine and
it's user interface (I'm still waiting for a VBA method to draw temporary
vectors and have to use a work around for that), but in over 20 years of
programming AutoCAD, inclusive of starting in VBA when it became available I
have never needed to use lisp for anything other an MNL file to call my VBA
commands.

The .NET environment removes the need for the MNL file functionality - it
may provide for temporary vectors, I don't know.

We are often told there are things you can do with lisp which you can't do
with anything else - but mostly they are things which for 99% of programs
don't need doing.

--


Laurie Comerford
CADApps
www.cadapps.com.au

"Kenneth Hutson" wrote in message
news:4856853@discussion.autodesk.com...
Som,

KrishnaK is right. Get to know the structure of the AutoCAD database. This
is foremost. Learn the capabilities and limitations of the languages
available. When confronted with a programming task, use your past experience
to select your language(s) based on the task at hand and the capabilities of
the language. In time your experience will grow. Try not to mix too many
languages together for a project.

I started with AutoLisp because that's all there was back then. VLisp gives
you an IDE and to me is the same thing as AutoLisp. AutoLisp offers a very,
very powerful way to manipulate the drawing database. You will find AutoLisp
can do things that other languages can't. If you are programming in AutoLisp
and need dialog boxes, use DCL. DCL was designed for AutoLisp. Don't
disregard it (as old fashioned as it appears).

VBA is cool. Form design just got alot easier. If you need to exchange
information between some other applications go with this. Try and explode a
hatch with it though.

I haven't had much experience with .NET Framework. I find it much like VBA.
More like VB. It's an exhastive collection of namespaces, classes,
properties and methods. Your biggest difficulty will be locating the correct
function to use.

Cheers,
Kenneth Hutson
San Antonio, TX
Message 30 of 49
Anonymous
in reply to: Somsekhar

Kenneth Hutson wrote:

> I haven't had much experience with .NET Framework. I find it much
> like VBA. More like VB.

.NET is nothing like VB.

> It's an exhastive collection of namespaces,
> classes, properties and methods. Your biggest difficulty will be
> locating the correct function to use.

That's a nice problem to have as opposed to having to find or write code
for common tasks.
Message 31 of 49
jbryant4
in reply to: Somsekhar

"We are often told there are things you can do with lisp which you can't dowith anything else - but mostly they are things which for 99% of programs don't need doing."................Actually, I think you have it backwards.......Should be....."We are often told there are things you can do in VBA, which you................but mostly they are things which 99% of programs don't need"...................Of course, this, both what you say and what I say, are personal opinion. DCL is cumbersome, but the background LISP that actually does the work (produce drawings, modify drawings, etc) will be much easier and typically far less code......AutoCAD VBA is most useful for linking to other APPS (Word, Excel, etc)....Oh and I forgot, the pretty dialog boxes.......I do have to admit, however, If I was new to programming AutoCAD, I would probably go the VB route, simply because I can use this programming experience in other places (unlike AutoLISP).....
Message 32 of 49
Anonymous
in reply to: Somsekhar

jbryant4 wrote:

> typically far less code

Functionality, efficiency, portability and functionality are what's
important, not a line count.
Message 33 of 49
jbryant4
in reply to: Somsekhar

Agree....However....Functionality - If it works, it works?.....Efficiency? - 0.00001 second vs 0.000015 second?....Portability - Most AutoLISP programs written for AutoCAD v9 still work today.
This has got me thinking......This may be a really stupid question, but........What does AutoDESK use to program all of the Dialog Boxes in AutoCAD......I believe AutoCAD 2000i is DCL....Not sure about 2002, 2004, 2006.........IF VBA is such a better system to program Dialog Boxes, why did (does?) AutoDESK still use DCL?....Maybe they have changed in newer versions 2004, 2005, 2006? Anybody know what is used now (2006)?
Message 34 of 49
Anonymous
in reply to: Somsekhar

jbryant4 wrote:

> This has got me thinking......This may be a really stupid question,
> but........What does AutoDESK use to program all of the Dialog Boxes
> in AutoCAD

C++.
Message 35 of 49
Anonymous
in reply to: Somsekhar

VBA has little to do with "linking to other apps".

VBA provides the infastructure for a common extensibility mechanism; but
each application has its own unique object model. If you're comfortable
with VBA in Excel, you'll be comfortable with VBA in AutoCAD; but that's
about as far as it goes.

Dan

wrote in message news:4858104@discussion.autodesk.com...
"We are often told there are things you can do with lisp which you can't
dowith anything else - but mostly they are things which for 99% of programs
don't need doing."................Actually, I think you have it
backwards.......Should be....."We are often told there are things you can do
in VBA, which you................but mostly they are things which 99% of
programs don't need"...................Of course, this, both what you say
and what I say, are personal opinion. DCL is cumbersome, but the background
LISP that actually does the work (produce drawings, modify drawings, etc)
will be much easier and typically far less code......AutoCAD VBA is most
useful for linking to other APPS (Word, Excel, etc)....Oh and I forgot, the
pretty dialog boxes.......I do have to admit, however, If I was new to
programming AutoCAD, I would probably go the VB route, simply because I can
use this programming experience in other places (unlike AutoLISP).....
Message 36 of 49
KrishnaK
in reply to: Somsekhar

And .NET Winforms. Check out the Layer dialog and CUI User Interface.
Message 37 of 49
Anonymous
in reply to: Somsekhar

Frank,
Good catch!
Kenneth

"Frank Oquendo" wrote in message
news:4858015@discussion.autodesk.com...
Kenneth Hutson wrote:

> I haven't had much experience with .NET Framework. I find it much
> like VBA. More like VB.

.NET is nothing like VB.

> It's an exhastive collection of namespaces,
> classes, properties and methods. Your biggest difficulty will be
> locating the correct function to use.

That's a nice problem to have as opposed to having to find or write code
for common tasks.
Message 38 of 49
Mikko
in reply to: Somsekhar

I started with autoLISP, used it for several years and gradually outgrew it. Totally bypassed vLISP, VBA and ObjectARX and jumped into VB3. I used that in combination with autoLISP. Back a few years the .NET Framework came into play and I've immersed myself into that. I still use VB, but is has progressed into what is called VB.NET. VB6 I believe is now unsupported or should be. I do not use autoLISP only in the most rare occasions. I find myself rewriting old code to VB.NET managed or unmanaged code using the COM interop or the new .NET API that is now available and growing. Examples can be found with some digging, thou you might want to get a big shovel at the moment. I can read C# and do use it but I prefer VB. Also, most of my coding is outside of the AutoCAD environment. AutoCAD and Inventor drawings are just different types of databases I need access so I can move the data to different offices and software around the globe. It boils down to what you are programming to what language you will learn first. You will learn several over the years if you keep at it. Get yourself that new Microsoft Visual Studio 2005 beta 2 and by the time you learn and write something, it should be released. It does have a go live license already should you complete your project before Microsoft completes theirs.

My 2 cents
Message 39 of 49
Somsekhar
in reply to: Somsekhar

O' Boy .....Am I making myself confused. Did I hear someone say ...Too much of anything is bad ...
I still can not figure out which way to start with.
What does ObjectARX facilitate ? And what if I directly work with Dot Net APIs by looking at the samples provided with ObjectARX download ?
Please ....would somebody take to pain to make the way simple for novice guys like me ? I want to start one by one.
Thank you all for all that info. But...please I am getting no where. I like the way Krishna and Mikako put their replies.
Message 40 of 49
Anonymous
in reply to: Somsekhar

How exactly is LISP easier than VBA? I find the syntax cumbersome and
somewhat vomit inducing, like perl.


wrote in message news:4858104@discussion.autodesk.com...
"Of course, this, both what you say and what I say, are personal opinion.
DCL is cumbersome, but the background LISP that actually does the work
(produce drawings, modify drawings, etc) will be much easier and typically
far less code......"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost