ksperopoulos Posted December 18, 2012 Posted December 18, 2012 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? Quote
MSasu Posted December 18, 2012 Posted December 18, 2012 VisualLISP is just an extension of AutoLISP, so you should begin with AutoLISP and continue with VL. Quote
BIGAL Posted December 18, 2012 Posted December 18, 2012 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 Quote
irneb Posted December 18, 2012 Posted December 18, 2012 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". Quote
ksperopoulos Posted December 18, 2012 Author Posted December 18, 2012 Thank you. I am already reading up on this and on my way to the "Promise Land"!!! Quote
BIGAL Posted December 19, 2012 Posted December 19, 2012 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 Quote
Pablo Ferral Posted December 19, 2012 Posted December 19, 2012 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. Quote
irneb Posted December 20, 2012 Posted December 20, 2012 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. Quote
Recommended Posts
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.