Author Topic: Getting off the Ground with .NET  (Read 22631 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Getting off the Ground with .NET
« Reply #30 on: April 19, 2011, 09:18:37 AM »
Fantastic - many thanks for your time Gile.

I shall take some time to look into implementing some of your suggestions.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Getting off the Ground with .NET
« Reply #31 on: April 19, 2011, 10:25:15 AM »
Gile, I am having trouble getting the scr to load, it keeps saying cant find.  Did you set a working directory on debug tab?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Getting off the Ground with .NET
« Reply #32 on: April 19, 2011, 10:40:17 AM »
I forgot something when using the script route:
In the 'start.scr' properties, set 'Copy to Output Directory' to 'Copy always' or 'Copy if newer' (see first picture).
If a script file is saved with your template, you'll only have to change the Assembly name in the script.

As I see my VS 2008 F# module is in English, i add a screenshot of the the project property window too.
The 'ConvHull.dwg' file is in the same folder as the solution so I used a relative path. Notice the path is within quotes and a space between the path and the command line arguments is required.
Speaking English as a French Frog

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Getting off the Ground with .NET
« Reply #33 on: April 19, 2011, 10:41:58 AM »
I've had so many problems trying to go the scripted netload route I gave up.  Now I just manually netload.  Not *that* much more work, since I usually have to do some set up in a test drawing anyways.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Getting off the Ground with .NET
« Reply #34 on: April 19, 2011, 10:46:33 AM »
yea, this is beginning to be a PITA.  I was just trying it because it was a new way to netload
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Getting off the Ground with .NET
« Reply #35 on: April 19, 2011, 10:47:10 AM »
What is weird is it trys to load the dll file, but cancels out.  If I manually type in what is in the scr file, it loads fine.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Getting off the Ground with .NET
« Reply #36 on: April 19, 2011, 11:12:22 AM »
Now for the Questions:

Here's where I am so far:

*  Firstly, am I following the correct procedure to test the code I linked to?

Confirmed (Gile)

*  Are the Project/File names arbitrary?

Yes (Gile)

i)  Is there a way to automatically have those DLLs added as References?

Using Template (Gile)

ii)  How does one know which DLL's are required, i.e. would I always need both AcDbMgd and AcMgd?

Unresolved.

iii)  VS2010 automatically adds quite a few other References:


Are these needed?

Unresolved.

*  In Step (4):  Is is possible to automatically set these properties?

Using Template (Gile)

*  In Step (5):  What is the difference between Building the Solution (F6) and Building using (Shift+F6)?

Unresolved.



With regards to using the Script for NetLoading - for the moment I think I shall stick to manually NetLoading the DLLs into AutoCAD, since I shall only be doing so to test code and not for working purposes. And, although the Script may be more streamline with fewer steps - I think I'll wait til I'm more confident in what I'm doing at the moment.

Thanks once again guys!

Lee

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Getting off the Ground with .NET
« Reply #37 on: April 19, 2011, 11:39:00 AM »
First, it's curious you have issues with the script way, I use it many times per day and don't have no problem.
IMO, if the script is launched (see the command line when AutoCAD starts) and the dll isn't found, maybe the script isn't correct (wrong assembly name...)
If the script isn't launched, maybe the command line arguments are wrong.

Anayway, the LISP solution works too (I used it a long time).

Quote
ii)  How does one know which DLL's are required, i.e. would I always need both AcDbMgd and AcMgd?
Yes, AcDbMgd.dll and AcMgd.dll have to be referenced (and copy local set to false) for every AutoCAD .NET project.
Some projects may require some other(s) one(s).

Quote
VS2010 automatically adds quite a few other References:
<snip>
Are these needed?
That depends what uses your project.
In a first time don't care about these, they're all set to 'copy flase' and allow you to access to many libraries you 'may' need, if you don't use them, they won't interact with your program.

Quote
*  In Step (5):  What is the difference between Building the Solution (F6) and Building using (Shift+F6)?
A solution may contains many projects 'Building the Solution (F6)' build the whole solution (every project it contains) 'Building (Shift+F6)' only build the selected project in the Solution Explorer.
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Getting off the Ground with .NET
« Reply #38 on: April 19, 2011, 11:43:55 AM »
Excellent!

Thanks for your explanations Gile - your time is appreciated.

Now, time for more studying  :-)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Getting off the Ground with .NET
« Reply #39 on: April 19, 2011, 02:21:01 PM »
i figured it out, I needed a return at end of line in scr file
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

StykFacE

  • Guest
Re: Getting off the Ground with .NET
« Reply #40 on: April 19, 2011, 02:35:39 PM »
This thread makes me drool since Lee is about to be more awesomer of a programmer.  :laugh:

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Getting off the Ground with .NET
« Reply #41 on: April 19, 2011, 02:41:18 PM »
i figured it out, I needed a return at end of line in scr file
I'm glad you got it.
A space (equals a return in the cryptic script langauge) was missing at the end of the line, I correct the message.
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Getting off the Ground with .NET
« Reply #42 on: April 19, 2011, 03:56:22 PM »
This thread makes me drool since Lee is about to be more awesomer of a programmer.  :laugh:

Thanks Styk, although I think it'll be some time before I am anywhere near the level of Kerry or Gile to name a few.  :kewl:

StykFacE

  • Guest
Re: Getting off the Ground with .NET
« Reply #43 on: April 19, 2011, 04:44:49 PM »
I'm sure that's true but given the fact that I've chosen my career path to be CAD related, I'll be around for awhile. I'm more wanting to see what nifty program you create more from curiosity than anything. You've always had such a good creative forecast when developing your programs that I respectively admire.  8-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Getting off the Ground with .NET
« Reply #44 on: April 19, 2011, 06:55:06 PM »

Quote
*  In Step (3):
    iii)  VS2010 automatically adds quite a few other References:
    Are these needed?
   
   The references are needed if the referenced dll's are used.
   If the References are not used having them listed will not cause any undue overhead.
   ... They are just references needed to resolve class definitions   

   //------------
Quote
*  In Step (5):  What is the difference between Building the Solution (F6) and Building using (Shift+F6)?
   F6 Builds the Solutuion ( may be several Projects).
   SHIFT-F6 Builds the specific current Project.   
   Building using F6 and SHIFT-F6 just build the assembly, and do not interactively start and link to AutoCAD.
   The benefit of a debug build is primarily that you can create a link between the IDE and AutoCAD.
   This can only be achieved by starting the process from the IDE.
   To achieve this, press F5 not F6. F5 will allow the use of code breakpoints and  perusal of variable values via the Intermediate and Locals windows.
   ... very helpfull in understanding what is going in in wour methods.
   
   //------------
   Script files are also handy for writing a reminder to the AutoCAD CommandLine regarding Command Names and descriptions
   .. a little easier than having an initialiser class for each project.
   
   Keep in mind that if you DO use netload from the CommandLine a History Folder will be available from the NetLoad Dialog after the initial load.
   
   //------------
   
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.