Author Topic: JavaScript for AutoCAD (among other things) . . . interesting  (Read 5159 times)

0 Members and 1 Guest are viewing this topic.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
« Last Edit: March 27, 2013, 11:41:41 AM by mohnston »
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: JaveScript for AutoCAD (among other things) . . . interesting
« Reply #1 on: March 26, 2013, 08:02:31 PM »
Yes, isn't it. I visualise a stampede to learn js, css, html for some people.

Also the 64-bit VBA 7.1  I imagine a lot of people forgoing their .net adventure :)


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.

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: JaveScript for AutoCAD (among other things) . . . interesting
« Reply #2 on: March 26, 2013, 10:58:34 PM »
Also the 64-bit VBA 7.1  I imagine a lot of people forgoing their .net adventure :)

Stand by for weird 64-bit incompatibilities in 3...2...1...http://msdn.microsoft.com/en-us/library/office/gg264421.aspx

I've also found VBA compiled in one version of AutoCAD often doesn't play nice in another, generally centred around project references etc. I, for one, am still .NET bound and never looking back.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: JaveScript for AutoCAD (among other things) . . . interesting
« Reply #3 on: March 27, 2013, 03:07:34 AM »
I'm inclined to think that post was inadvertently released 6 days early.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

TheMaster

  • Guest
Re: JaveScript for AutoCAD (among other things) . . . interesting
« Reply #4 on: March 27, 2013, 03:34:50 AM »
Also the 64-bit VBA 7.1  I imagine a lot of people forgoing their .net adventure :)

Stand by for weird 64-bit incompatibilities in 3...2...1...http://msdn.microsoft.com/en-us/library/office/gg264421.aspx

I've also found VBA compiled in one version of AutoCAD often doesn't play nice in another, generally centred around project references etc. I, for one, am still .NET bound and never looking back.

VBA early-binds to COM type libraries, which have always been release-specific in AutoCAD, so not much has changed there. Pretty much every release has required VBA projects to be recompiled after removing and re-adding references to the AutoCAD type libs.

The real issues are about breaking managed code, which seems to have become a favorite pasttime.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #5 on: March 28, 2013, 11:33:06 AM »
Looks like the study I've been doing on HTML and JavaScript (limited though it is) may come in handy sooner than I thought.
I won't be doing my happy-dance just yet though.

I'll raise my usual war cry ... 'Show me the documentation'
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
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.

BlackBox

  • King Gator
  • Posts: 3770
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #7 on: March 30, 2013, 01:18:04 PM »
More important than Javascript ...
TRUSTEDPATHS (System Variable)
<snip>

This had to be my favorite line (sarcastically) from the Beta forums on this topic:

Quote from: Autodesk Employee
AutoCAD will only prompt for SCR files that are located on network locations (and are outside trusted locations).  So no effect to using /b switch, as long as the script file is local. 

You will get an alert when loading a SCR from a network location (if not a trusted location). The rationale for that was it was deemed riskier to load SCR files from the network.
« Last Edit: March 30, 2013, 07:14:57 PM by BlackBox »
"How we think determines what we do, and what we do determines what we get."

TheMaster

  • Guest
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #8 on: March 30, 2013, 01:58:47 PM »
Looks like the study I've been doing on HTML and JavaScript (limited though it is) may come in handy sooner than I thought.
I won't be doing my happy-dance just yet though.

I'll raise my usual war cry ... 'Show me the documentation'

From looking at Kean's latest posts, it appears that js/html5 requires a network connection, or perhaps I'm mistaken?

fxcastil

  • Guest
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #9 on: March 30, 2013, 08:37:28 PM »
DesignScript is a unique language. It is intended to help designers build and analyze complex geometric models that would be difficult to model with interactive techniques.

http://labs.autodesk.com/utilities/designscript

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #10 on: March 30, 2013, 09:32:26 PM »
DesignScript is a unique language. It is intended to help designers build and analyze complex geometric models that would be difficult to model with interactive techniques.

http://labs.autodesk.com/utilities/designscript

Sorry, I don't understand the relevance of this link to JavaScript or Security .. care to explain ?
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.

fxcastil

  • Guest
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #11 on: April 01, 2013, 10:50:50 AM »
DesignScript is a unique language. It is intended to help designers build and analyze complex geometric models that would be difficult to model with interactive techniques.

http://labs.autodesk.com/utilities/designscript

Sorry, I don't understand the relevance of this link to JavaScript or Security .. care to explain ?

It has nothing to do with JavaScript, I was responding to the (among other things) part of the title in the original post.
Since someone mentioned 64 bit VBA as being something new.

I also mentioned DesignScript as being another feature/programming capability being added to AutoCAD.

http://www.youtube.com/watch?v=G4WOIJtRE74





Jeff H

  • Needs a day job
  • Posts: 6150
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #12 on: April 01, 2013, 11:02:56 AM »
Is DesignScript really a new language when other than some mixed/managed classes written to talk to AutoCAD database, it is just C# including the UI, parser, etc.....

BlackBox

  • King Gator
  • Posts: 3770
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #13 on: April 01, 2013, 11:53:16 AM »
DesignScript was announced last year (AutoCAD 2013)... Not exactly new.  :lol:
"How we think determines what we do, and what we do determines what we get."

Jeff H

  • Needs a day job
  • Posts: 6150
Re: JavaScript for AutoCAD (among other things) . . . interesting
« Reply #14 on: April 03, 2013, 01:52:40 AM »
Updated the Xrecord class in 2014

Code - C#: [Select]
  1. [Wrapper("AcDbXrecord")]
  2. public class Xrecord : DBObject, IEnumerable<TypedValue>
  3. {
  4.     // Methods
  5.     public Xrecord();
  6.     internal Xrecord(IntPtr unmanagedPointer, [MarshalAs(UnmanagedType.U1)] bool autoDelete);
  7.     public void Append(ResultBuffer data);
  8.     public XrecordEnumerator GetEnumerator();
  9.     internal unsafe AcDbXrecord* GetImpObj();
  10.     public virtual IEnumerator IEnumerableGetEnumerator();
  11.     public virtual IEnumerator<TypedValue> IEnumerableTypedValueGetEnumerator();
  12.  
  13.  
  14.     // Properties
  15.     public ResultBuffer Data { get; set; }
  16.     public override DuplicateRecordCloning MergeStyle { get; set; }
  17.     public bool XlateReferences { [return: MarshalAs(UnmanagedType.U1)] get; [param: MarshalAs(UnmanagedType.U1)] set; }
  18. }
  19.  
  20.  
  21.  
  22. Expand Methods

That's a start.


MLeader.Scale  is finally added.
Document.IsNamedDrawing Ehhhh....
I guess if you read this then you can read "What's New".