CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 2627 

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))
(prin1)
) 

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).

ACAD
100% *  CAD 
7.3.2011    7936×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12701:What is the maximum length of a list in AutoCAD VisualLISP?
Tip 11914:Maze generator for AutoCAD.
Tip 10955:Evaluate VBScript functions from AutoLISP.
Tip 10647:How to store macros inside DWG drawings?
Tip 9996:AutoCAD 2015 reports "VVC: internal error"


Back   All CAD Tips All CAD tips&tricks



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   



Featuring:
Increase your productivity with our set of BIM add-on functions for Autodesk Revit
CADstudio Revit Tools More info


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