Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visual LISP and Autolisp

19 REPLIES 19
Reply
Message 1 of 20
Anonymous
1082 Views, 19 Replies

Visual LISP and Autolisp

Hi every body,
What is Visual lisp and Autolisp?
What is their role and importance and advantage in autocad?
If I have to begin learning any of them, which one is to be learn first? Can any one put light upon this....Thanks
19 REPLIES 19
Message 2 of 20
Anonymous
in reply to: Anonymous

there is no difference I am aware of, unless it is the vl- commands that have not always existed.
if you are getting your feet wet I have two suggestions.

afralisp.net - fairly comprehensive for pre vl- commands - tutorials too. dialog boxes, etc.

the vlisp editor in autocad - vlide on my command line.
really decent help files and colour coded and indented formatting.
I wish I had a little more control on the formatting, because I like mine longer left to right than top to bottom.

have fun, get your feet wet.

roy
Message 3 of 20
Anonymous
in reply to: Anonymous


Autolisp is a form of the lisp programming language tailored
specifically for AutoCAD.  Visual Lisp adds new feature sets to lisp,
allowing it to extend its influence to access additional object model
components.

 

I would definitely suggest learning lisp first, then adding
vlisp techniques where appropriate.
Message 4 of 20
Anonymous
in reply to: Anonymous


Sorry, I meant learning Autolisp first.  There is no real
need to learn the actual lisp programming language, beyond general syntax and
concept.  All of which is already covered in
Autolisp.
Message 5 of 20
Anonymous
in reply to: Anonymous

Thanks you very much .... Mr Curmudgeon and Mr Tim Decker....you both put me in the right track.














there is no difference I am aware of, unless it is the vl- commands that have not always existed.
if you are getting your feet wet I have two suggestions.

afralisp.net - fairly comprehensive for pre vl- commands - tutorials too. dialog boxes, etc.

the vlisp editor in autocad - vlide on my command line.
really decent help files and colour coded and indented formatting.
I wish I had a little more control on the formatting, because I like mine longer left to right than top to bottom.

have fun, get your feet wet.

roy
Message 6 of 20
Anonymous
in reply to: Anonymous

Thanks you very much .... Mr Curmudgeon and Mr Tim Decker....you both put me in the right track.














there is no difference I am aware of, unless it is the vl- commands that have not always existed.
if you are getting your feet wet I have two suggestions.

afralisp.net - fairly comprehensive for pre vl- commands - tutorials too. dialog boxes, etc.

the vlisp editor in autocad - vlide on my command line.
really decent help files and colour coded and indented formatting.
I wish I had a little more control on the formatting, because I like mine longer left to right than top to bottom.

have fun, get your feet wet.

roy
Message 7 of 20
Anonymous
in reply to: Anonymous

farad51 wrote:
> Hi every body, What is Visual lisp and Autolisp? What is their role and
> importance and advantage in autocad? If I have to begin learning any of
> them, which one is to be learn first? Can any one put light upon
> this....Thanks

This is an unnecessary confusion created by history. AutoLISP is what
AutoCAD had originally (since version 2.5 or whatever). Visual Lisp
started life as an outside product called Vital Lisp, which Autodesk
bought somewhere around 2000, and renamed.

Nowadays AutoCAD only has one Lisp implementation which has both parts
combined. The base language syntax is the same, what Visual Lisp bought
is just a lot of additional functions with names starting with VL. So
from the language learning viewpoint, there is no difference, it is the
same language regardless of the name.

Both parts can be used mixed together (assuming type conversions etc as
needed), so there is no need for the distinction. Nowadays the names are
occasionally used to signify the different tools used: in the AutoLISP
style modifying the drawing database happens using DXF codes using
ENTMOD and related functions. Visual Lisp gave the possibility to work
using the ActiveX interface (undocumented, except for the "ActiveX and
VBA" documents and a few rules how to build the calls from Lisp)

- Another new capability from Visual Lisp is using reactors. (see the
documentation for the vlr -functions.)


--
Message 8 of 20
Anonymous
in reply to: Anonymous

My thanks goes to Martti who also put light on both LISP.
Message 9 of 20
Anonymous
in reply to: Anonymous


to add to martti's excellent post.

 

I think the main issue with vlisp vs lisp is that vlisp
brought object oriented programming to autolisp, in a similar way as what
clos did for lisp

 

to clarify, vlisp allows for objects methods and
properties.  working with objects in plain autolisp means assoc lists and
dxf codes.  vlisp also allows for event handling error trapping versus
autolisp's error handling.

 

Jamie

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
My
thanks goes to Martti who also put light on both
LISP.
Message 10 of 20
Anonymous
in reply to: Anonymous

Visual LISP hasn't really brought OOP to AutoLISP.

Object-oriented programming languages all share a
few common traits that Auto/VisualLISP do not have.

The most notable is that oop is not merely about
consuming objects, it is equally about defining new
classes of objects. There's nothing really OOP about
Visual LISP. The only kind of 'objects' you can use,
are ActiveX objects.

In real OOP, you can not only use objects, you can
define new classes of objects; give them properties
and methods, etc., and you can derive new classes
of objects from existing ones.

CLOS does bring real OOP to LISP, but Visual LISP
does not do that for AutoLISP.

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"Princess Jamie" wrote in message
news:6154473@discussion.autodesk.com...
to add to martti's excellent post.

I think the main issue with vlisp vs lisp is that vlisp brought object
oriented programming to autolisp, in a similar way as what clos did for lisp

to clarify, vlisp allows for objects methods and properties. working with
objects in plain autolisp means assoc lists and dxf codes. vlisp also
allows for event handling error trapping versus autolisp's error handling.

Jamie

wrote in message news:6154293@discussion.autodesk.com...
My thanks goes to Martti who also put light on both LISP.
Message 11 of 20
stevor
in reply to: Anonymous

1. They are programming languages that operate within the Autocad; they allow the user to automate some activities.

2. For the user, they can save work time for complex or iterated CAD actions.
For Autodesk, the Autolisp provided a means of attracting clients without requiring Autodesk to write a million job-specific functions and commands, and so enabled Autodesk to compete with the established CAD services at a small fraction of their cost. It was a key to transitioning from red ink to black, see the founder's comments in www.fourmilab.ch/autofile/www/autofile.html.
Now they help maintain the client base because most of the clients are dependent on their specific programs; and they hepl Autodesk develope new functions and services.

3. Learn the Autolisp first, as it was designed to be VERY easy to put to use.
Then learn the parts of Vlisp that will benefit your work, especially with curves.
Then be aware of other languages within Autocad, or without, that might be profitable.
S
Message 12 of 20
Anonymous
in reply to: Anonymous

>So from the language learning viewpoint, there is no difference,

Well, yes and no.

It should be true, but if you read anything on "how to program in LISP" &
try to apply it to some of the Active X implementation, you will likely tear
your hair out. Apart from (as you said) lack of documentation, some of these
functions are atrocities, from a LISP point of view.

Specifically, "how to" articles will tell you that well behaved LISP
functions should return a value, which can be used as input to another
function.

However, some (many?) of the Active X functions, when called from LISP,
return nil even if successful, while setting variables as side effects,
instead of returning a value. You must guess what the side effects are (no
real documentation) and, if you want a proper LISP function, write your own
wrapper to bash the output into better shape so you can attempt to write
some decent LISP with it. (Thx. to Tony T. for examples, long ago).

quote TT:

>In real OOP, you can not only use objects, you can
define new classes of objects; give them properties
and methods, etc., and you can derive new classes
of objects from existing ones.

Which maybe leaves the door open for 3rd party(ies) to bring this to
AutoLISP, if anyone with the ability has also the desire.
( I don't see this happening. Who would pay for it? But then, there is ODCL,
so who knows?)

This looks more promising, to me:

http://through-the-interface.typepad.com/through_the_interface/2008/10/au-handouts-aut.html

Too bad you can't plug the "workbench" (or whatever it is called) into the
AutoCAD command line.:)

A note, the only way to *consume* the AX interface in ACAD 2010, using
*only* what ships with the product, is AutoLISP.

(Yes, you can download the VBA module, if you insist on riding a dead
horse).

Message 13 of 20
Anonymous
in reply to: Anonymous

It has occurred to me that the entire notion of "Visual Lisp" is an oxymoron. It seems a bit strange to speak of OOP in the context of a Lisp language. Just a thought from a non-programmer who has been writing neat little stuff in Auto/Visual Lisp for many years. Simple. Effective. Nice for us old guys who'd rather not learn a new paradigm if we can avoid it.
Message 14 of 20
Anonymous
in reply to: Anonymous

Herman, I like the sound of what I imagine you refrained from saying
there... 😮
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


Herman Mayfarth wrote:
>> So from the language learning viewpoint, there is no difference,
>
> Well, yes and no.
>
> It should be true, but if you read anything on "how to program in LISP" &
> try to apply it to some of the Active X implementation, you will likely tear
> your hair out. Apart from (as you said) lack of documentation, some of these
> functions are atrocities, from a LISP point of view.
>
> Specifically, "how to" articles will tell you that well behaved LISP
> functions should return a value, which can be used as input to another
> function.
>
> However, some (many?) of the Active X functions, when called from LISP,
> return nil even if successful, while setting variables as side effects,
> instead of returning a value. You must guess what the side effects are (no
> real documentation) and, if you want a proper LISP function, write your own
> wrapper to bash the output into better shape so you can attempt to write
> some decent LISP with it. (Thx. to Tony T. for examples, long ago).
>
> quote TT:
>
>> In real OOP, you can not only use objects, you can
> define new classes of objects; give them properties
> and methods, etc., and you can derive new classes
> of objects from existing ones.
>
> Which maybe leaves the door open for 3rd party(ies) to bring this to
> AutoLISP, if anyone with the ability has also the desire.
> ( I don't see this happening. Who would pay for it? But then, there is ODCL,
> so who knows?)
>
> This looks more promising, to me:
>
> http://through-the-interface.typepad.com/through_the_interface/2008/10/au-handouts-aut.html
>
> Too bad you can't plug the "workbench" (or whatever it is called) into the
> AutoCAD command line.:)
>
> A note, the only way to *consume* the AX interface in ACAD 2010, using
> *only* what ships with the product, is AutoLISP.
>
> (Yes, you can download the VBA module, if you insist on riding a dead
> horse).
>
>
Message 15 of 20
Anonymous
in reply to: Anonymous

> I like the sound of what I imagine you refrained from saying

James-
I likd that song, too.

http://www.lyricsdepot.com/simon-garfunkel/sounds-of-silence.html

:)
Message 16 of 20
Anonymous
in reply to: Anonymous

Herman Mayfarth wrote:
>> So from the language learning viewpoint, there is no difference,
>
> Well, yes and no.
>
> It should be true, but if you read anything on "how to program in LISP" &
> try to apply it to some of the Active X implementation, you will likely tear
> your hair out. Apart from (as you said) lack of documentation, some of these
> functions are atrocities, from a LISP point of view.

While ActiveX is not a very lispy interface to connect to in any case,
Visual Lisp gives me the impression that whoever wrote the currently
published interface, was either no Lisp programmer, otherwise
incompetent, or deliberately trying to make it as clumsy to use as
possible. Given the difference between vlax-invoke (deprecated) vs.
vlax-invoke-method I rather suspect the last one.

But still, VL didn't change the language syntax, control constructs,
evaluation rules or semantics (apart from adding vlax-for, rudimentary
error handling and reactors).

--
Message 17 of 20
Anonymous
in reply to: Anonymous

James,

on that other thing I am working on and you are working on......
about the only thing of import left is what part of the gbXML to export.
some of my example files are too incomplete while the other uses undocumented features.
going to just throw something on the wall and see what sticks.

but I've learned so much in this process, like the minimum requirements for a 3d face.
my flash drive I have been working from must be at the other computer just now, but to entmake a 3dface I believe is
(entmake (list '(0 . "3dface")(list 10 pt1)(list 11 pt2)(list 12 pt3)(list 13 pt4)))
easier than a lwpoly - I was using 3d faces to visually check the data I was writing to file.
but I see application for lots of 3d stuff, like elevations, duct, stuff. faces are much more cool than I had imagined.

regards,

roy
Message 18 of 20
Anonymous
in reply to: Anonymous

>While ActiveX is not a very lispy interface to connect to in any case,
>Visual Lisp gives me the impression that whoever wrote the currently
>published interface, was either no Lisp programmer, otherwise
>incompetent, or deliberately trying to make it as clumsy to use as
>possible.

Yes, I agree.
(maybe even all three:)

> Given the difference between vlax-invoke (deprecated) vs.
>vlax-invoke-method I rather suspect the last one.



Paranoia
Will destroy ya.
:)


>But still, VL didn't change the language syntax, control constructs,
>evaluation rules or semantics (apart from adding vlax-for, rudimentary
>error handling and reactors).

Yes, I agree.
Message 19 of 20
Anonymous
in reply to: Anonymous

I looked at your post on the web side and noticed that the part you
enclosed in angle brackets does not show up there. So the web side
readers may have no idea what I wasn't referring to...



Hah! Hidden messages for newsreader users only. Okay, enough.
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


Herman Mayfarth wrote:
>> I like the sound of what I imagine you refrained from saying
>
> James-
> I likd that song, too.
>
> http://www.lyricsdepot.com/simon-garfunkel/sounds-of-silence.html
>
> 🙂
Message 20 of 20
Anonymous
in reply to: Anonymous

Thanks MR Stevor and others who participated in the debate.

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

Post to forums  

Autodesk Design & Make Report

”Boost