Jump to content

Recommended Posts

Posted

Im just attmepting to complete the hello world tutorial from Autodesk for the express version of C#; but already I have become stuck and cannot find in the properties for my project the option to start external programs in the debug menu. Can anyone help?

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • wannabe

    19

  • CmdrDuh

    15

  • jkristia

    2

  • ASMI

    1

Top Posters In This Topic

Posted

you need to manually create a user file, that points to your exe. BRB I will go get you an example

Posted
1) Test in AutoCAD

To test this in AutoCAD we can have Visual Studio start a session of AutoCAD. Right click on “Lab1” project in Solution Explorer and select “Properties”. In the Lab1 Property Pages dialog select ‘Debug’, check ‘Start External Program’ and use the ellipses button and browse to acad.exe. After changing this setting, hit F5 key to launch a session of AutoCAD.

The “NETLOAD” command is used to load the managed application. Type NETLOAD on the AutoCAD command line to open the “Choose .NET Assembly” dialog. Browse to the location of “lab1.dll” (..\lab1\bin\debug), select it and then hit open.

Enter “HellowWorld” on the command line. If all went well, the text “Hello World” should appear. Switch to Visual Studio and add a break point at the line: ed.WriteMessage(“Hello World”). Run the HelloWorld command in AutoCAD again and

 

Thats the Autodesk training literature i downloaded. It makes it seem as though there should be an option to debug with an external program. But in my debug tab there is nothing there. I tried the project and even the class properties incase I was doing it wrong.

Posted

your not doing it wrong, Microsoft removed that option from the express editions to try and get you to upgrade and pay $$$

 

make a file with the same name as your proj file and put this txt in it

Program

C:\Program Files\AutoCAD Civil 3D 2008\acad.exe

n:\

Program

C:\Program Files\AutoCAD Civil 3D 2008\acad.exe

n:\

ProjectFiles

en-US

false

 

like Helloworld.proj.user

Posted

And change the paths to be your pathing structure

Posted

Ok, thanks for that. I'll give it a shot in the next hour once im free.

 

Cheers.

Posted

Any chance you could run through that in a step by step manner, being a bit more detailed? My apologies, sorry.

Posted

here is a shorter version. and the page I got it from. I will also add the cs files you need so you can see the example.

 

Program

C:\Program Files\AutoCAD 2007\acad.exe

Autodesk debugging page

Posted

Im actually using ACAD 2008 at home. Will I just need to amend the 2007 in the code or is there more to it than that?

Posted

I have a couple of questions regarding C# / AutoCAD.

#1 - is it possible to create a plugin which can be added to any of the menus or panels?

#2 - is it possible to create dialogs which will behave like the 'array' dialog, where it will disappear to let you select and then re-appear?

#3 - is it possible to create and add additional 'draw' tools, or can it only does the API only work on existing object ?

 

Maybe someone can point me to some online tutorials and document taion ?

Posted

1, yes, your tools can be added to toolbars, panels, pulldowns etc.

2, yes, similiar to the way VBA works

3, depends on what you want.

Posted
Im actually using ACAD 2008 at home. Will I just need to amend the 2007 in the code or is there more to it than that?

thats it, just edit that path

Posted
1, yes, your tools can be added to toolbars, panels, pulldowns etc.

2, yes, similiar to the way VBA works

3, depends on what you want.

 

Can you point me to where I can find more information about the API ?

(I'm not asking about the coding itself, that I have no problems with).

 

edit edit edit .... a quick googling for 'AutoCAD API' pointed me to autodesk developer center'. I will take a look there first :)

Posted

Finally got round to attempting this but im stuck between steps four and five.

 

I have the files you sent me. But what do I do with them now? Am I meant to copy them to the C# express install folder, because it is not arranged the way yours is in the illustration.:(

Posted

Although the debug starts autocad when I load up your code. So if i keep thinking i should be able to figure this out myself - not that you havent helped me a lot already.

Posted

ok i copied the file into my project and now it works. Although, being honest, I dont fully understand waht i've done.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...