Jump to content

Recommended Posts

Posted

I have read on this forum and others that there is not much difference in Autolisp and Visual Lisp. I have also read on this forum about the many highly regarded tutorials. I am taking your advice to go through the tutorials on http://www.afralisp.net. But they reference both Autolisp and Visual Lisp tutorials. I am assuming I should go down the Visual Lisp path since AutoCad has the Visual Lisp Editor. Am I correct or confused or both?

Posted

VisualLISP is just an extension of AutoLISP, so you should begin with AutoLISP and continue with VL.

Posted

Vl has some nice extra stuff that makes some tasks a bit easier than plain lisp but like MSasu learn plain lisp first. Get used to "Command"

 

Lisp use Assoc to get properties of an object (assoc 8 obj) need DXF code numbers

VL (VLA-get-layer obj) more obvious that you want the layer name

Posted
Lisp use Assoc to get properties of an object (assoc 8 obj) need DXF code numbers

VL (VLA-get-layer obj) more obvious that you want the layer name

Of course there's nothing stopping you from having a set of "constants" to make your code more readable as well. E.g.
(setq DXF_Layer 
(assoc DXF_Layer obj)

Actually in all languages it's considered good practise to use constants instead of "magic values". And IMO these DXF codes are nothing if not "magic values".

Posted

Thank you. I am already reading up on this and on my way to the "Promise Land"!!!:D

Posted

Keep a list handy of the Vla-gets with a bit of a explanation

 

vla-get-insertionpoint vla-get-tagstring vla-get-textstring vla-get-name vla-get-color vla-get-layer

Posted

Think of Autolisp as a scripting language. Essentially you are automatic what you would usually do at the command line. Visuallisp is object orientated - so it's much more powerful.

 

Don't get confused by the vlide ide. You can incorporate both Autolisp and visuallisp into the same programs. Afralisp is a great place to start:

skatterbrainz.blogspot.co.uk/search/label/visual%20lisp

Is also very useful.

Posted
Think of Autolisp as a scripting language. Essentially you are automatic what you would usually do at the command line. Visuallisp is object orientated - so it's much more powerful.
Not exactly. ALisp is only a script if you use only the command stuff. It becomes a true program as soon as you use stuff like entget / entmod / entmake / etc. In some cases those things can achieve what VLisp can't because they operate on the raw DXF data.

 

I wish VLisp was OO, that would have made life a whole lot simpler, including being able to use RDNZL to be able to link directly to the DotNet libraries. VLisp is only linking to the ActiveX/COM library which itself is designed as OO, though the creators of VitalLisp (the original extension) did use the same structure as was implemented in Common Lisp's Object System (CLOS), only they just made it into a "read-only" structure - meaning you can only use objects, not make them.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...