Can SharpDevelop IDE (Instead of Visual Studio) be used to program AutoCAD?

Can SharpDevelop IDE (Instead of Visual Studio) be used to program AutoCAD?

muckmailer
Collaborator Collaborator
5,940 Views
38 Replies
Message 1 of 39

Can SharpDevelop IDE (Instead of Visual Studio) be used to program AutoCAD?

muckmailer
Collaborator
Collaborator

SharpDevelop is a free IDE for C sharp that is portable and does not require all the installation procedures that Visual Studio does. 

 

Can SharpDevelop IDE be configured to program AutoCAD?

 

I have tryed to use SharpDevelop with some of my previous CAD.net projects created with Visual Studio but I get some namespace and

cs0246 errors. I have reduce many of those error by reloading references and setting local copy to False. Now I am confronted with processor 

Architectures errors. 

 

Has anyone ever tryed to used SharpDevelop IDE to program AutoCAD. 

 

 

Thank you,

 

0 Likes
Accepted solutions (1)
5,941 Views
38 Replies
Replies (38)
Message 21 of 39

muckmailer
Collaborator
Collaborator

I like to program in AutoCAD with visual Studio. I prefer to do that over actually drawing in AutoCAD but

there seems to be no opportunity in programming AutoCAD.  The job i have now I could not even place one

of my routines on their computer.  Most employers I have had seem to prefer me to take 40 hours to manually

do redundant work over using a routine that could cut time into an hours. Most employer are i have had are

very short  sighted. 

 

muckmailer

0 Likes
Message 22 of 39

muckmailer
Collaborator
Collaborator

Thank you for responding to my post. I am all ways interested in programming AutoCAD even

if I have to program  as a hobby at home.  I am all ways open to alternatives.

 

muckmail

0 Likes
Message 23 of 39

JamesMaeding
Advisor
Advisor

@muckmailer

I tell people to automate tasks and charge that time to their projects. The managers don't need to know why you got done twice as fast 🙂

The more you program, the easier it gets, as you build up functions and things you can reuse. Keep climbing that mountain! PM me if you ever need help getting going. I do tons of lisp and .net for my job.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 24 of 39

dgorsman
Consultant
Consultant

@JamesMaeding wrote:

@muckmailer

I tell people to automate tasks and charge that time to their projects. The managers don't need to know why you got done twice as fast 🙂

The more you program, the easier it gets, as you build up functions and things you can reuse. Keep climbing that mountain! PM me if you ever need help getting going. I do tons of lisp and .net for my job.


Good lord, no...

 

Look, if someone is supposed to be working on drawings and instead is writing code they're not only *not* getting their work done, they're causing problems by doing it wrong or creating a different work process.  Everyone doing their own thing, their own way is incredibly wasteful in time spent and creates a bunch of different results.  Yes, someone may consider they're the next greatest thing since sliced cheese (programmatically or otherwise) but guess what - those layer settings you're using are wrong.  As are the text styles.  And we already have standards controls in place which work, so they don't need re-writing by everyone.

 

And yes - I *have* run into this situation.  A user slipped in their own tool set and didn't say anything until the drawings wouldn't print properly using the client settings.  And now half the drawings on the project not only print wrong but look wrong because they use a completely different set of blocks.  Not "twice as fast".  Not even close.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 25 of 39

JamesMaeding
Advisor
Advisor

@dgorsman

Well, yah, if you do tools that cut corners but end up in the wrong place, its not going to help anyone. An incompetent person can cause all kinds of problems without customization.

People need to have their eyes open to ways of improving things, for both their employer's good and their own.

My own criteria for users is they can do anything they want as long as the product they make is within our requirements. Customization does not have to affect products, it totally depends what you do. We at H&A have tons of utilities that just do things better than OOTB acad, not different. Then we have many that you have to use to do a task correctly.

I love to hire people with customization skills as they know what can be done, and then I show them how to organize their stuff within our system. A competent cad manager should be able to handle customization from the outside. They may not approve all of it, as I myself do not let users dump 200 lisps they found into their lisp folder, causing more confusion than anything. Those people are so rare though, that I work with each one and show them how to stay organized.

The good users love it, as all they got before was resistance. Its all about a balance, and I encourage all users to learn lisp and at least make some of their own key-ins that script stuff, like:

(DEFUN C:]   () (PRINCM "\nDraworder to Front")(COMMAND ".DRAWORDER" (SSGET) "" "F") (PRINC))
(DEFUN C:[   () (PRINCM "\nDraworder to Back")(COMMAND ".DRAWORDER" (SSGET) "" "B") (PRINC))

Those just speed up work, and prevent black wrist brace disease.

BTW, that PRINCM function is same as PRINC, but I wrapped it with PRINCM so I can use that in our routine that searches for key-ins with certain keywords. You type PK here, then a word like front, and it spits out a list of key-ins that have the word front after the PRINCM function. So yes, we have so many key-ins that we have a search function.

I'll post the code for any of this if anyone asks.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 26 of 39

muckmailer
Collaborator
Collaborator

What version of Visual Studio goes with AutoCAD 2019?

Where can net wizard be downloaded for AutoCAD 2019?

Does anyone know how much disk space the programs take?

Seems like visual studio program versions all ways change for 

a different version of AutoCAD. 

 

Thank you,

 

0 Likes
Message 27 of 39

FRFR1426
Collaborator
Collaborator

If you're using ObjectARX/C++, you need the right compiler chain. For AutoCAD 2019, you need Microsoft® Visual Studio® 2017 with Update 2 and C++ installed. You can find this information in the SDK, file arxdev.chm, topic Autodesk ObjectARX for AutoCAD 2019: Developer's Guide > ObjectARX Introductory Concepts > Overview of ObjectARX > Getting Started Software Development Environment and System Requirements

 

For .NET/C# you only need a version of Visual Studio that supports the target framework version (.NET 4.7) so you can use also Visual Studio 2015 if you install the 4.7 Dev Pack.

 
Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 28 of 39

JamesMaeding
Advisor
Advisor

@muckmailer

I avoid the wizard, as you really should know how to set up from scratch (and I would argue you have to anyway).

Its like you must know the ingredients, and they are not hard, so why use a wizard?

You have to have the references, proj set as compile to dll, and possibly tweak the csproj.user to make debug start acad like:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files (x86)\AutoCAD Civil 3D 2009\acad.exe</StartProgram>
    <StartArguments>/nologo /p "HA_C3D2009" /b "C:\+Storage\Programming\DotNet\AcadXtra\AcadXtraR17 Load.scr"</StartArguments>
    <StartWorkingDirectory>C:\+Storage\Programming\DotNet\AcadXtra\bin\Debug\R17\</StartWorkingDirectory>
  </PropertyGroup>

 

I do that as the free versions of VS tried to keep you from starting another prog in debug, but its 2 seconds to get around. I just think the wizard hides things you will have to immediately learn and troubleshoot anyway (like, oops, the references are not copy local = false...) and stuff like that. Setting up from scratch, after looking at an example project, is the way to go IMO.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 29 of 39

muckmailer
Collaborator
Collaborator

I have always used Autodesk wizards with out problems

I have never done a setup manually.  Is there a good link to instruct me on that.

If there is a problem with AutoCAD 2019 and Autodesk wizzard for 2019 maybe I should

say with AutoCAD 2015 and visual studio.  I really want to get the setup done

and get programming. I don't want to get caught up in the installation process.

If I choose to use VS2017 and AutoCAD 2019,  I guess free Visual Studio Express 1017 or

whatever MS wants to call it is available through MS website.

 

Thank you, 

 

    

 

 

0 Likes
Message 30 of 39

deisenbeisz
Contributor
Contributor

I realize this is an old post, but I think you miss the entire point of OP's original question.  Some of us are VERY experienced AutoCAD users who are also experienced in using some of its various iterations, such as Civil 3D (or LD Desktop to go back a few years).  Some of those same people took advantage of using the powerful customization tools that Autodesk provided: first AutoLISP, then the Visual Lisp IDE, and subsequently the VBA IDE.  Obviously, the VBA IDE was based upon the VBA IDE for Microsoft Office, which was great for those of us WHO ARE NOT PROGRAMMERS BY TRADE because many of us were already familiar with using it for customizing Excel.  We are engineers, designers, and possibly graphic artists who have little interest in understanding the complexities of a software package like Visual Studio.  We couldn't possibly care less about its impressive list of compilers and supported languages, how powerful its interface is, or versatile it is because all we want to do is customize our flavor of AutoCAD and automate repetitive tasks.  That's it.  We aren't interested in cross-platform flibbity-floo and we definitely do not want to create apps for anybody's phone.  So, the OP, and the power users who agree with him, have been ignored and told we have to learn MS Visual Studio, which is a freaking nightmare to install and configure, not to mention that it takes up ridiculous amounts of hard drive space due to its primary purpose as a software development tool and commitment to useless bloat.  The VBA IDE that we know and love has been deprecated by Autodesk, which is fine, but then they should have created a similar tool for their .Net environment and not just left us non-developers hanging.  I am waiting for the next shoe to drop when Autodesk abandons VBA and AutoLISP code altogether and all of the macros we have taken years to write and make work exactly as we want them to work will suddenly be rendered useless.

 

So, in an extension to the OP's question, is there anything out there we can use to write customization macros in the Autocad .Net environment that won't require a 6-month training course just to learn how to make work exactly like the pedestrian VBA IDE we know and love?  Yes, you can laugh at us for being a bunch of unsophisticated dullards, but we would rather design highways and buildings than learn to configure and work in MSVS.

0 Likes
Message 31 of 39

JamesMaeding
Advisor
Advisor

@deisenbeisz 

I agree the switch to .net is deeper than the VBA dive is (was).

I think to answer your question, you probably can use other tools than VS to write .net for acad, but by the time you deal with them and their disadvantages, its likely not a good compromise.

Not having the IDE built in is a BIG disadvantage of .net, no question about it whatsoever.

Its a two edge sword - the install of VS and getting a working hello world prog takes time and focus, but once its going there are enough people and posts to do whatever you want using the .net api. The thing I like is there are so many free libraries out there you can make use of eventually. Its not a good answer though, the middle ground VBA option has essentially gone away. I don't blame autodesk on this one either (may be a first for me!).

The sad thing is the adesk .net blogger, Kean Walmsley, got pulled off his role to much less useful things IMO. His blog, through the interface, made up for some of the adesk sins but now Kean is looking into machine learning...oh well, at least his past blog posts are still there and like a manual.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 32 of 39

deisenbeisz
Contributor
Contributor

@FRFR1426 wrote:

VBA is dead. It is not cross platform. Use Javascript instead.


Why in the world would we care about cross-platform?  Does Autodesk really think I would ever have a need to produce highway plans or design a residential subdivision on my phone or in a browser window?   VBA was simple, easy to learn, and integrated near-flawlessly with MS Office.  That is all 99 percent of us want to do.  The only people who think that it matters whether VBA is cross-platform are youngsters who never started with AutoLISP and/or developer snobs who write code for a living.  Well, I hate to burst Autodesk's bubble, but most of their users do not write code for a living.  So if VBA is dead, I guess I will go back to the endless parentheses of AutoLISP and you can have your Javascript.

0 Likes
Message 33 of 39

deisenbeisz
Contributor
Contributor

Hahahaha.  I just read through the posts in this topic and discovered that I had already responded to the OP a while ago.  Yes, it seems every few months I look for a good alternative to AutoCAD, mostly because they are forcing us to learn visual studio, and I run across this thread.  Sorry for slamming it again with my negativity, but Autodesk is really pushing their luck with the way they treat their customers.  Good day to everyone and please don't take anything I have posted too seriously.  Just call it a bad day trying to make Civil 3D 2017 and MS Excel play nice together.

0 Likes
Message 34 of 39

JamesMaeding
Advisor
Advisor

@deisenbeisz 

I do the same thing, keep looking around for alternatives so I have a plan B for mission critical tools.

The javascript answer is way off the radar IMO, don't waste time on that.

.net does not have to be too hard though, if you have people that can guide you through.

There are a couple things I have found to make using VS quite easy. Once you have the pattern down, the biggest trouble is getting VS installed on any machine you want to debug on.

I really like the .net api though compared to com. Its about the same difficulty but way faster when you need to do things like draw 5,000 leaders or lots of entities. Its been the best thing ever for me, but I am non-billable so have the time to push through. Its only a few tricks though to smooth out 90% of the VS headache.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 35 of 39

FRFR1426
Collaborator
Collaborator

VBA is a Microsoft Product (discontinued in 2008, last update in 2010), it is not developed by Autodesk. Microsoft has decided to replace VBA with new technologies like .NET .

 

So VBA, AutoLISP are not maintained anymore (the last update of AutoLISP was made in 1999 with the integration of Visual LISP in AutoCAD 2000), it's life.

 

One day it will be .NET which will be deprecated.

 

There is no conspiracy to make VBA disappear, it's just the evolution of technologies. Visual Studio and the .NET framework are great products, OK it takes some time to install but this opens up a whole world of possibilities for you.

 

So stop grumbling and write code to make our everyday tools better.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 36 of 39

muckmailer
Collaborator
Collaborator

In a few older versions of AutoCAD VBA was installed when AutoCAD was installed.

It did not have the features of VS.net but was better than lisp and it had some nice programming

features. That was very nice for a drafter who wanted to do some light programming.  It was better than

Lisp. 

For the newer versions of AutoCAD you have to install VS.net and go through all those installation

procedures. Anymore you even have to match the correct version for VS.net with the correct version of

CAD. I just think the VS..net installation is a nightmare for a drafter who wants have some light AutoCAD 

programming abilities at their fingertips.

 

 

0 Likes
Message 37 of 39

_gile
Consultant
Consultant

Hi,

 

If you want to keep on using VBA (you seem to like it), You can simply download and install the VBA module.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 38 of 39

JamesMaeding
Advisor
Advisor
@muckmailer (hmm, the @ is not turning blue today...), As I understand it, the current VBA runs worse than before too, as its 32 bit. We can all play the violin for you, and ourselves, but reality is these APIs come and go through time. I would argue adesk has brilliantly preserved its APIs through time. I can't think of another program that has a scripting language like lisp, com, .net, and a c++ API. I hate how they do business, but love good old acad. Appreciate the good things 🙂

internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 39 of 39

CADbloke
Advocate
Advocate

@JamesMaeding wrote: ... As I understand it, the current VBA runs worse than before too, as its 32 bit. 

Nope, it's 64-bit  (or 32 bit if you want that one)- check out the VBA downloads page previously linked: https://knowledge.autodesk.com/support/autocad/downloads/caas/downloads/content/download-the-microso...

 

You're not going crazy, for a while they did shoehorn the 32 bit VA runtime into 64 bit AutoCAD and it was a mongrel dog of a thing. They fixed it. Surprise! Just make sure you use the right one.

Disclaimer: I haven't touched VBA since Santa was real, I'm be mostly C#ing these days,

- - - - - - -
working on all sorts of things including www.tvCAD.tv & www.CADreplace.com