CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products []
Cesky English Deutsch
 Visitors: 2442 

CAD tip CAD tip # 7840:

Question CAD 
 %  platform  category 
Q - question

What are the differences between AutoLISP and VisualLISP?

A - answer Dialects of the LISP programming language are available in AutoCAD since its initial versions. AutoLISP in AutoCAD offers functions for interactive data entry, processing and access to the AutoCAD drawing database (DWG). VisualLISP (originally "Vital LISP") was added to AutoCAD in the versions R14 (as an add-on) and 2000 (integrated).

With VisualLISP you can do more than with the pure AutoLISP - you can edit, compile and debug your programs, use object (ActiveX) functions and reactors. VisualLISP contains the integrated editing and debugging environment (IDE).

An example of a typical program in AutoLISP:

(defun C:Circle2 ()
(setq pt (getpoint "\nCenter of the circle: "))
(setq r (getdist r "\nRadius: "))
(command "_CIRCLE" pt r)
(command "_CIRCLE" pt (/ r 2.0))

To create drawing objects you can either call AutoCAD commands - (command), or directly create entities - (entmake), or use ActiveX functions (vla-add*).

With VisualLISP, .lsp programs can be compiled to .vlx and .fas files (code protection, better performance).

Before calling COM (ActiveX) objects in VisualLISP you need to load the COM support with the function (vl-load-com).

100% *  CAD 
7.3.2011    5310x  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
Tip 10955:Evaluate VBScript functions from AutoLISP.
Tip 10647:How to store macros inside DWG drawings?
Tip 9996:AutoCAD 2015 reports "VVC: internal error"
Tip 8543:Setting command line background color from LISP.
Tip 7959:How to add layer description in AutoLISP?

Back   All CAD Tips All CAD tips&tricks

Ribbon and its appearance on dual-screen configurations. « | » QRcodeConverter - insert QR codes in Inventor drawings.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Export 3D VRML scenes from AutoCAD and Inventor 2015
VRMLout More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.