Community
Community Classifieds
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New AutoCAD programming language and library: .NETScript and AutoCAD.X

1 REPLY 1
Reply
Message 1 of 2
khoa.ho
7095 Views, 1 Reply

New AutoCAD programming language and library: .NETScript and AutoCAD.X

Hello everyone,

 

This is my pleasure to introduce a new CAD programming tool .NETScript CAD, which can be found at the website www.netscriptcad.com

 

What is .NETScript?

.NETScript is a new programming language for CAD software, which is C# with JavaScript syntax. The used library is AutoCAD.X that is an extension of AutoCAD .NET API, but simpler to use, one line of code to run any single task.

 

Why we need .NETScript?

CAD developers will still use C# to write code, but the same code will work on both AutoCAD desktop and the web at http://www.netscriptcad.com/code-store. Since AutoCAD supports varieties of programming platforms, .NETScript is an alternative to DesignScript but still have the strength of .NET API and the cross-platform of JavaScript.

 

What is the difference between .NETScript and C#?

.NETScript is C# but make use of JavaScript syntax, so the same code will work on both AutoCAD and the web browser. Developers will write the same code for computer (Windows), tablet and mobile devices (iOS, Android,…).

 

What is the difference between .NETScript and JavaScript?

.NETScript looks similar to JavaScript but remove the strongly-typed limitation of JavaScript with object-oriented foundation. Therefore, the web compiler will parse .NETScript to native JavaScript to run on the web browser.

 

What is the difference between AutoCAD.X and AutoCAD .NET API?

.NETScript for AutoCAD uses AutoCAD.X which is an extension of AutoCAD .NET API, but the new API is short and simple with JavaScript oriented. Therefore, .NETScript is easy to use for both drafters and developers, for both CAD developers and JavaScript web developers.

 

How .NETScript compare to other CAD development languages?

.NETScript does not get developers off their familiar .NET languages, like DesignScript or JavaScript, faster than VBA and AutoLISP, drafter’s minded like AutoLISP, web minded like JavaScript. Developers can also use the independent AutoCAD.X library to reference into their .NET projects. Code less and work on many platforms is the target of .NETScript.

 

How does .NETScript support?

.NETScript plans to support many Autodesk products: AutoCAD (standard and vertical), Revit, Inventor, Maya, and Navisworks with their according extension libraries: AutoCAD.X, Revit.X, Inventor.X, Maya.X and Navisworks.X.

 

What is the base platform to run .NETScript?

.NETScript supports not only Autodesk products but also alternative software such as Bricscad and nanoCAD, which will use Teigha.X, an extension of Teigha.NET API.

 

NETScriptCAD.com is the website to download .NETScript for AutoCAD plugin, store and collaborate AutoCAD dynamic drawings and sample .NETScript code. The website has the online code editor for developers to write code and try out right the way on the web, without AutoCAD needed.

 

How is .NETScript different?

NETScriptCAD.com provides a scripting interface to execute the code directly on the web browser or send to the server (will be supported for massive cloud computing). The cool secret thing is developers can automate AutoCAD using the web browser. Code on the web can drive AutoCAD without ActiveX automation, use with the new command NETSERVER.

 

What is dynamic drawing?

Dynamic drawing is a normal DWG drawing but contains built-in .NETScript code to do automation for this drawing. Like HTML page with JavaScript, DWG file is considered as HTML and stored .NETScript code is considered as JavaScript to drive this drawing.

 

To create a dynamic drawing, after loading .NETScript for AutoCAD plugin into AutoCAD, type NETSCRIPT command to show the code editor, type the code and hit Save (or Ctrl-S). Then this drawing will become dynamic. When this drawing is opened next time, run NETSCRIPT command again to see its stored code and then manually execute it. .NETScript does NOT allow automatic execution for binary security, no unexpected code allow to run without user permission.

 

New AutoCAD commands from .NETScript for AutoCAD:

 

NETSCRIPT: show the code editor (which supports intellisense and code completion) which is Basic Code Editor by default, users can switch to Advanced Code Editor (still in development).

 

NETSERVER: turn AutoCAD into remotely automation, users can use the web browser (point to http://www.netscriptcad.com/code-store) to remotely drive local AutoCAD.

 

NETRUN: run the given online URL of .NETScript file (.ns extension) or the given file location on local computer.

 

NETSHARE: to be announced.

 

> : this is a special command, to turn AutoCAD into command line code execution. For example, hit “>” key and Enter, then type code LineX.From(0, 0, 0).To(200, 100, 0) to draw a line. It is just simple as AutoLISP.

 

Getting started with .NETScript for AutoCAD and WebCAD (at http://www.netscriptcad.com/code-store😞

 

Draw a green line: LineX.From(10, 12, 0).To(200, 100, 0).ColorIndex(3);

Draw multiple continuous lines: LineX.From(0, 0, 0).To(10, 20, 0).To(30, 20, 0);

Draw a circle: CircleX.From(50, 50, 0).Radius(100);

Insert a block reference with attributes: BlockX.Insert("TestBlock", @"C:\Temp\TestBlock.dwg").SetAttributeValues(new Dictionary<string, string> { { "NAME", "NetScript" } });

Write message to AutoCAD editor: EditorX.WriteMessage(“Hello to .NETScript for AutoCAD”);

Zoom extents the current viewport: EditorX.ZoomExtents();

 

.NETScript uses suffix “X” for its classes, to allow AutoCAD.X to work together with the official AutoCAD .NET API. So developers can make use of AutoCAD.X library for their .NET projects, no need to learn new languages.

 

.NETScript CAD now releases for technology preview, to receive feedback from developers. .NETScript for AutoCAD and AutoCAD.X library are still on beta testing and the AutoCAD.X API is still being updated and changed. For the latest software download, please get it from http://www.netscriptcad.com/download . For now, there is still no installation package, just unzip the downloading package and use NETLOAD to load the file NetScript.Acad.Plugin.dll into AutoCAD. The current build is used for AutoCAD 2013. I plan to build .NETScript for AutoCAD from 2009 version upward.

 

.NETScript CAD is still on development as my side home project (I am still working full-time now). I need to protect my ideas and tools. Autodesk or someone who tries to replicate my solutions needs to ask for my permission and copyright. I used to plan to introduce .NETScript on the time of AU 2012 but wait until now to make it more mature. So I hope Autodesk will protect ideas for developers and software vendors.

 

Thank you,

 

Khoa Ho

www.netscriptcad.com

 

1 REPLY 1
Message 2 of 2
khoa.ho
in reply to: khoa.ho

Hi everyone,

 

It has been exactly a year for the first introduction of NETScriptCAD.com. I am working on a new website NetOnApp.com since last year which is the successor of NETScriptCAD.com

 

NetOnApp.com was presented as an exhibitor at Autodesk University 2013 in Las Vegas last year. This website is designed to be the central point to download .NETScript plugins and automate Autodesk software (recently AutoCAD) using the web browser.

 

I hope to push .NETScript plugins on the market soon, so developers can enjoy the new way of using web technologies to control AutoCAD. Please stay tuned for what will happen this year.

 

Thank you,

 

Khoa Ho

www.NetOnApp.com

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report