trying to get started

trying to get started

Anonymous
Not applicable
1,435 Views
16 Replies
Message 1 of 17

trying to get started

Anonymous
Not applicable

Visual Studio Express 2013 -> Autocad 2015

 

does this combination work?

 

i cannot get past the first line of "my first plugin", launch "Visual Basic 2010 Express" and pick the template "Autocad Plug-in" from the installed templates. there is no template. i have downloaded and installed  net wizards and orbject arx sdk from the autocad developer page.

 

should i use visual basic express 2012?  should i start using autocad 2016?

 

is there a simple little table somewhere with some setup combinations?

 

 

 

 

0 Likes
1,436 Views
16 Replies
Replies (16)
Message 2 of 17

Anonymous
Not applicable

i managed to draw a liine creating a dll and doing netload. i will get it.

 

 

0 Likes
Message 3 of 17

Anonymous
Not applicable
C# wizard was there, but missing vb wizard, had to download, but these are old, for autocad 2014, this is messy. http://forums.autodesk.com/t5/net/autocad-net-wizard-installed-but-no-vb-plugin/td-p/5479211
0 Likes
Message 4 of 17

brianchapmandesign
Collaborator
Collaborator

Definately confusing when you first get started.  I think they setup of tutorials, etc for those with some C or VBA programming background. Diving in is tough but lots of great peeps out there willing to help. Best of luck to you, and welcome to the madness 🙂


"Very funny, Scotty. Now beam down my clothes.
0 Likes
Message 5 of 17

Anonymous
Not applicable

i assume at this point i have downloaded the autocad 2014 vb.net template from a third party website that will work sufficiently well with vs studio 2013 and autocad 2015. 

 

actually i have plenty of vba and vb6, i understand the out of process concept of managing autocad. i dont really understand the advantage of the in-process plug-in. i dont want to make a command, there are enough commands, i want to manage information to make drawings, from a form where the user inputs the parameters for the current job and makes a stack of drawings and cutsheets.  i wont give up learning, but i might table the idea of porting my application.

 

thanks,

 

 

 

 

 

 

 

0 Likes
Message 6 of 17

JamesMaeding
Advisor
Advisor

Hi Art,

I use VS express 2013 with acad 2015 and bricscad v15.

The work perfectly, so do not look for other versions, unless you want to go higher than vs 2013.

As long as the vs version supports the .net framework your acad uses (4.5 for 2015), you are good.

 

If you use express, and make a fresh project, it will seem to not work with debugging in acad.

You need to modify the myprog.csproj.user to have code like this, that tells it what to start when you debug:

 

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files\Autodesk\AutoCAD 2015\acad.exe</StartProgram>
    <StartArguments>/nologo /p "HA_C3D2015" /b "C:\+Storage\Programming\DotNet\AcadXtra\AcadXtra 2015 Load.scr"</StartArguments>
    <StartWorkingDirectory>C:\+Storage\Programming\DotNet\CTCivilXtra\bin\Debug</StartWorkingDirectory>
  </PropertyGroup>
</Project>

tweak the params as needed, you can likely just have the acad.exe path for startarguments, not the /p /b stuff.

 

 

I recommend you try using C# instead of vb, as the people with the answers seem to prefer it. Many came from c++ backgrounds so have a taste for it.

I do not use templates, as you need to know how to make things from scratch, and its so easy anyway.

 

As far as making drawings from params, you can do that really nicely with .net, but you must run .net things from within an acad session.

You might use the coreconsole.exe portion of acad to get that session, it is like acad at the dos prompt.

Otehrs can comment how to start a minimized acad session with .net.

Note that cheaper clones of acad like bricscad have .net api's also, so are good options IMO.

 

The trick with .net is learning how to structure helper functions so you build libraries of subroutines that simplify certain things.

.net uses "transactions" like c++, so lets you shove in lots of entities at once to the db, while vb and lisp only do one transaction per entity.

Its a 10x speed increase or more in many cases to use .net.

Also, the VS environment is uber slick.

For some fun, read up on what extension methods are. Once you define them, they show up on the intellisense list when you type . after some variable.

So vs suggests methods defined for just that type, which is awesomely handy if you have hundreds of helper functions.

It narrows down the list for you.

Only bummer is to debug, it startes a session, then closes it when done, no code editing allowed while open, just debug info.

So you find the issue, stop debug, fix, then start again.


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

Message 7 of 17

arcticad
Advisor
Advisor

Here are the cliff notes to setup a new project without a template.

 

Create a new Class Library Project in VB.

Click on the Show All Files icon in the Solutions Explorer.

You will see references. Right Click and Add References.

Click on Browse and add the following references from your AutoCAD folder.

accoremgd
acdbmgd
acmgd

 

go into properties for each reference and set Copy Local to false.

 

Also Add a reference to Windows.Systems.Forms in the NET Tab of Add References
Note: if you insert a userform this will automatically be added

 

Add the following code to a class file
--------------------------------------------

Imports Autodesk.AutoCAD.Runtime

Public Class clsHelloWorld

<CommandMethod("HelloWorld", CommandFlags.Session)> _
Public Sub HelloWorld()
Windows.Forms.MessageBox.Show("Hello World")
End Sub

End Class

--------------------------------------------

Save your project and edit the myprog.vbproj.user file as mentioned above and run the program

 

type "netload" and select the myprog.dll file in the debug folder of your project.

type "helloworld" as the command line.

---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 8 of 17

dgorsman
Consultant
Consultant

One minor change from the above: reference the DLL files from the SDK, rather than the AutoCAD install.  That's what they are there for.

----------------------------------
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 9 of 17

JamesMaeding
Advisor
Advisor

what about com references? Can those be done the same way, or do you have to have the install done?

I use some com for civil3d objects because you are forced to.


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

0 Likes
Message 10 of 17

dgorsman
Consultant
Consultant

The SDK includes AutoCAD Interop reference DLLs as well.  I'm not certain if there is a dedicated SDK for Civil3D, if not then yes - you would need to reference the install for non-AutoCAD stuff.

----------------------------------
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.


0 Likes
Message 11 of 17

arcticad
Advisor
Advisor

Ggorsman, Can you post some information about the SDK, I've never used it. 

 

What are the advantages and where can I find the files.

 

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 12 of 17

dgorsman
Consultant
Consultant

ObjectARX SDK downloads: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550

 

Contains help files and references.  The use of these references are recommend by Autodesk; they only contain a stub which is all you really need for developing, unlike the full install.  There have been a few posts here which go into detail about this, the ones I'm thinking of aren't popping in the search list.

----------------------------------
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 13 of 17

BKSpurgeon
Collaborator
Collaborator
apparently, there are some issues with referencing the standard Acad fields. i read somewhere in the documentation which says "just do it" so i didnt' question it.
0 Likes
Message 14 of 17

BKSpurgeon
Collaborator
Collaborator

Hi

 

Welcome. Welcome. welcome to the forum. Please step, right this way sir: 

 

I would strongly suggest to you - urge, if not pleading - for you to get rid of the express one and install the Community edition. Here it is:

 

https://www.visualstudio.com/downloads/download-visual-studio-vs

 

It has great features and better functionality than the express edition. Options are seriously limited in the express edition. Do yourself a favour and just install the community edition.

0 Likes
Message 15 of 17

brianchapmandesign
Collaborator
Collaborator

2014 is "binary compatible" with 15-16. 13 will require different refrences.


"Very funny, Scotty. Now beam down my clothes.
0 Likes
Message 16 of 17

brianchapmandesign
Collaborator
Collaborator

I'll 2nd the Vis studio comment.

 

I have a decent Civil3d Template here:

 

http://pro-cad.net/Pro-caddotNet%20C3d%202014%20VS%20Template.zip

 

It's not perfect, but close 🙂


"Very funny, Scotty. Now beam down my clothes.
0 Likes
Message 17 of 17

JamesMaeding
Advisor
Advisor

I am interested in why the community one is better. Can you list main advantages?

It was not even on my radar when I got the express edition so I'm new to it.


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

0 Likes