wannabe Posted November 5, 2008 Author Posted November 5, 2008 And now it wont work in CAD lol. What a joke. Quote
CmdrDuh Posted November 5, 2008 Posted November 5, 2008 what is it doing? did you netload the dll file? Quote
CmdrDuh Posted November 5, 2008 Posted November 5, 2008 ok i copied the file into my project and now it works. Although, being honest, I dont fully understand waht i've done. If you look at picture 3, you have created a command called "Helloworld" When you type that in, it runs the code below that, which creates an editor object, and feeds it the string "Wanabe's first App" to the command line Quote
wannabe Posted November 5, 2008 Author Posted November 5, 2008 I copied your file into my lab1 project. Then it successfully built the dll in my debug folder. Autocad then starts and i netload the lab1.dll from my debug folder. When i type in HelloWorld it says unknown command. The code is as per the manual and there are no errors. Quote
wannabe Posted November 5, 2008 Author Posted November 5, 2008 Your code works fine. So maybe I have misunderstood what is required when copying the file to enable me to run it in CAD. All I did was copy your file with all the AutoCAD shortcuts into my folder; Im guessing thats wrong. Quote
CmdrDuh Posted November 5, 2008 Posted November 5, 2008 when you say you copied the file into project, did you copy the dll or open the solution and copy from the cs file? Quote
wannabe Posted November 6, 2008 Author Posted November 6, 2008 when you say you copied the file into project, did you copy the dll or open the solution and copy from the cs file? I copied the csproj.user file from the file you sent me into my own version of the Hello World command (called Lab1). the debug then worked perfectly; loading AutoCAD in the same way as it did from your file. Subsequently I went into my debug folder and the Lab1.dll was there so I NETLOAD it. But, when I type in HelloWorld its an unknown command. I had both our codes open side by side (class1.cs) and apart from the text that displays on the commandline (Hello World for and Wannabe... for you) the code is the same. So, in short, the debug loads CAD but my command is unknown - but your command works and loads perfectly. Therefore, is this probably an issue with copying the file from one folder to another (the file that had the code in to load AutoCAD as the debug program? Quote
wannabe Posted November 6, 2008 Author Posted November 6, 2008 Still puzzled with this one. Driving me mad. I think I will have to continue the training using your code and establish what went wrong with mine at a later date. Quote
CmdrDuh Posted November 7, 2008 Posted November 7, 2008 2 things, did you add the references to the 2 dll files from the Autocad folder and set local to false? Second, can you zip up your project and email it to me at cmdrduh@gmail.com ? Quote
wannabe Posted November 7, 2008 Author Posted November 7, 2008 You're an excellent help. You have mail. Quote
ASMI Posted November 7, 2008 Posted November 7, 2008 > wannabe .NET training video from Autode$k http://usa.autodesk.com/adsk/servlet/index?id=1911627&siteID=123112 When we will see the first line of your code? Quote
wannabe Posted November 7, 2008 Author Posted November 7, 2008 > wannabe .NET training video from Autode$k http://usa.autodesk.com/adsk/servlet/index?id=1911627&siteID=123112 When we will see the first line of your code? LOL As funny as it may seem. Not too long from now (I hope a few months time) I will be fairly well educated in the philosophy of C# (through research and practice) and will have done a few basic programs. So by then I will be looking form some basic CAD requirements that you may have for me. If you want to make it as professional as possible i.e you're the customer and I am the programmer who also runs the business, that would be excellent from my point of view. To get me thinking and acting out in the environment I aspire, and aim, to be in. thanks for the link. EDIT: Just as practice, as I don't expect to produce code worthy of profit for a long time. Quote
wannabe Posted November 7, 2008 Author Posted November 7, 2008 I should have found that video myself. But cheers, its a great help to my theory and practical education. Quote
CmdrDuh Posted November 7, 2008 Posted November 7, 2008 acmgd is set to copy local TRUE. change that and recompile and see what happens Quote
CmdrDuh Posted November 7, 2008 Posted November 7, 2008 Here is Wannabe's code, which appears to be correct, except for the copy local part [size=2][color=#0000ff] using[/color][/size][size=2] System; [/size][size=2][color=#0000ff]using[/color][/size][size=2] System.Collections.Generic; [/size][size=2][color=#0000ff]using[/color][/size][size=2] System.Linq; [/size][size=2][color=#0000ff]using[/color][/size][size=2] System.Text; [/size][size=2][color=#0000ff]using[/color][/size][size=2] Autodesk.AutoCAD.ApplicationServices; [/size][size=2][color=#0000ff]using[/color][/size][size=2] Autodesk.AutoCAD.EditorInput; [/size][size=2][color=#0000ff]using[/color][/size][size=2] Autodesk.AutoCAD.Runtime; [/size][size=2][color=#0000ff]namespace[/color][/size][size=2] Lab1 { [/size][size=2][color=#0000ff]public[/color][/size][size=2] [/size][size=2][color=#0000ff]class[/color][/size][size=2] [/size][size=2][color=#2b91af]Class1 [/color][/size][size=2]{ [[/size][size=2][color=#2b91af]CommandMethod[/color][/size][size=2]([/size][size=2][color=#a31515]"HelloWorld"[/color][/size][size=2])] [/size][size=2][color=#0000ff]public[/color][/size][size=2] [/size][size=2][color=#0000ff]void[/color][/size][size=2] HelloWorld() { [/size][size=2][color=#2b91af]Editor[/color][/size][size=2] ed = [/size][size=2][color=#2b91af]Application[/color][/size][size=2].DocumentManager.MdiActiveDocument.Editor; ed.WriteMessage([/size][size=2][color=#a31515]"Hello World"[/color][/size][size=2]); } } } [/size] Quote
wannabe Posted November 7, 2008 Author Posted November 7, 2008 For some reason I only thought the other CAD reference needed to be set as false. Thanks for your comments. Quote
Recommended Posts
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.