Author Topic: The PowerShell hosting inside of AutoCAD  (Read 7447 times)

0 Members and 2 Guests are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
The PowerShell hosting inside of AutoCAD
« on: February 03, 2016, 12:56:51 PM »
Here is the sample (code sources) of PowerShell 4.0 hosting inside of AutoCAD 2016. Here is video. Here is compiled version for AutoCAD 2016.

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: The PowerShell hosting inside of AutoCAD
« Reply #1 on: February 03, 2016, 04:05:45 PM »
WOW. This is great - what a great way to write and run "disposable" scripts. This is like scriptcs or Linqpad's lprun for AutoCAD. Well done.

Apart from copy-paste into a text editor, is there any way to save your script if you write it in the new IDE?

If you want to turn it into Visual CADstudio, http://avalonedit.net/ is a good editor with syntax highlighting etc and it is MIT licensed.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #2 on: February 03, 2016, 04:18:31 PM »
Ewen, it is not IDE or text editor. :) It is a simple "Hello World" for demonstration of opportunity of PowerShell in AutoCAD. There are the PowerShell GUI controls by Microsoft. More info is here (I didn't try it still). Thank you for the link, I'll read it.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #3 on: February 08, 2016, 03:49:24 AM »
Ewen,

Additional info for your consideration: it is possible through AutoCAD .NET API to write LISP functions for creating PowerShell engine instance and working with it through LISP. At this case for LISP will be accesseble complete capabilities of .NET, all (or almost all) Microsoft technologies and its platforms.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #4 on: February 08, 2016, 07:42:59 AM »
There are interesting resources:
http://netonapp.com/
http://www.netscriptcad.com/

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: The PowerShell hosting inside of AutoCAD
« Reply #5 on: February 09, 2016, 05:35:21 PM »
There are interesting resources:
http://netonapp.com/
http://www.netscriptcad.com/
These are intriguing but it seems to have zero interest. The web site is half-finished and many parts of it don't work. I really like the idea but it is very hard to find out how it actually works.

Sort of related and also interesting: http://drive-cad-with-code.blogspot.com.au/search?q=asp.net

Ewen, it is not IDE or text editor. :) It is a simple "Hello World" for demonstration of opportunity of PowerShell in AutoCAD....
Yes, and a nice example too. I really like what this can do.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #6 on: February 10, 2016, 03:31:27 AM »
These are intriguing but it seems to have zero interest. The web site is half-finished and many parts of it don't work. I really like the idea but it is very hard to find out how it actually works.
You are right. Khoa [the author of that site] told me:

Quote from: Khoa
The website NetOnApp.com is outdated and does not show correctly what the current software is. I will update it with information.

I'll send to Khoa the link to this topic, therefore it is possible he can answer here about current status of .NetScript. His project seems interesting for me, but I still haven't free time for deep studying of it.

Sort of related and also interesting: http://drive-cad-with-code.blogspot.com.au/search?q=asp.net
Thank you, it is interesting.  I'll read it when I have free time.


CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: The PowerShell hosting inside of AutoCAD
« Reply #7 on: February 10, 2016, 03:48:46 AM »
...when I have free time.
No time is "free", there is always a cost. I laugh at my past self when I thought I was busy - BC (Before Children) and before www.tvCAD.tv

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #8 on: February 10, 2016, 03:53:25 AM »
...when I have free time.
No time is "free", there is always a cost. I laugh at my past self when I thought I was busy - BC (Before Children) and before www.tvCAD.tv
I spend a lot of time for studing of PowerShell and SharePoint (it is necessary for my work). These tasks are in the highest precedence for me. :)

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #9 on: February 10, 2016, 05:50:23 AM »
I gave some minutes for .NETScript while I drink cofee... I think .NetScript is raw still. :-( On my test virtual machine with AutoCAD 2009-2016 x64 I often get Fatal Errors from .NETScript in AutoCAD 2016 x64 when I switch its any tabs. The same problem I have with AutoCAD 2014 x64. Look attached screen, please. I hope Khoa will fix it.
« Last Edit: February 10, 2016, 06:16:00 AM by Andrey Bushman »

khoa

  • Guest
Re: The PowerShell hosting inside of AutoCAD
« Reply #10 on: February 10, 2016, 11:26:42 PM »
Hi Andrey,

I am not sure if you are using the latest .NETScript downloaded at the website www.NetOnApp.com. Please see the below screenshot of this plugin in AutoCAD 2016 x64.

Thanks,
Khoa



Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #11 on: February 11, 2016, 04:40:29 AM »
Hi Khoa,
I am not sure if you are using the latest .NETScript downloaded at the website www.NetOnApp.com.
Hm... But I've downloaded that installer yesterday from here. I don't know why, but that link opens not the same page where from I downloaded your installer. In that page I used some menu item (look it in the attached screens). That menu item uses the same url adress, but other content.
Also, look at my attached screens, for version of .NetScript, please.
« Last Edit: February 11, 2016, 04:50:24 AM by Andrey Bushman »

khoa

  • Guest
Re: The PowerShell hosting inside of AutoCAD
« Reply #12 on: February 11, 2016, 10:05:21 AM »
Hi Andrey,

You are using the latest version of .NETScript (1.6.20.0 at this moment). The version info from the website is not tight to the current downloaded assemblies.

If users use the older version, it will display an "Update" button at the lower left of the application dialog. Move mouse over it to see the latest version number. Click on this "Update" button to download and install the latest version from internet.

Can you make sure you can see the same screenshot like the below image. Thanks.
« Last Edit: February 11, 2016, 02:39:45 PM by Khoa Ho »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The PowerShell hosting inside of AutoCAD
« Reply #13 on: February 11, 2016, 02:18:24 PM »
Can you make sure you can see the same screenshot like the below image. Thanks.
I can't, because I get Fatal Error each time when I try open that [Programming] tab.

khoa

  • Guest
Re: The PowerShell hosting inside of AutoCAD
« Reply #14 on: February 11, 2016, 02:38:39 PM »
I got other testers who can see the Programming tab in Revit. I am not sure what is missing on your system. Here is a quick check for your issues:

In Windows, open Event Viewer, then expand Applications and Services Logs at the left pane, click on NetOnApp node to see any errors may happen with .NETScript. Please see the below screenshot.