Tuesday
AutoLISPDifference between AutoLISP and VisualLISP
General programming info
Hello DailyAutoCAD readers,
In my today’s article, I will explain the difference between AutoLISP and VisualLISP. VisualLISP, which is available since AutoCAD version R14, has provided many uses .
In order for you to understand the difference in a better way, I will gice two different programs below. One of them is C:F1 and the other one is C:F2 function (Code.3). Both of their functionalities are the same: they will give red color property to any entity you select in the drawing area.
It is obvious that sub program “Change-Color-F1” (Code.1) that is used by the C:F1 function is much more complicated. If you want to make changes over entities in AutoLISP, than you have to have the DXF information.
Visual Lisp / ActiveX programming method requires experience, however, if you want to make changes over an entity, it is easier to use the functions (methods) that belong to that entity. Thus, in order to make changes in the color, you should use vla-put-color method. There is no need for a superior english knowledge, methods are already given meaningful names.
Name of ActiveX, which has been released by Microsoft for VBA applications, is always used in VisualLISP programming language, because its principles are based on VBA.

Code.1 – LISP function “Change-Color-F1“, which works with DXF.

Code.2 – Active-X Function “Change-Color-F2“.

Code.3 – Main functions “C:F1” and “C:F2“.
Have a nice day. File for the example given in this article: compare-lisp-func.lsp.
Bu yazinin Turkce’sini okumak icin basiniz.
Viewed 11,151 times so far... This week: 77 Today: 2 Latest: 5 July 2009, 0:25Post Tags:
Related Posts
Popular
- Hip tip: Increasing view resolution with VIEWRES system variable
07/03/2009 04:39 am
7 Comments - Sirince – IZMIR
07/02/2009 11:02 am
1 Comment - Visual LISP: Programming user interfaces with OpenDCL
07/01/2009 10:15 pm
10 Comments - 3D Modeling 7: EXTRUDE
06/30/2009 02:14 pm
10 Comments - Ask DailyAutoCAD: Which Notebook to Buy?
06/30/2009 12:17 pm
1 Comment
Featured Articles
- AutoCAD 2009 Update 3 Released
- Speed Up As AutoCAD 2009 Ribbon Menu Helps You!
- MEP Analysis Extension for AutoCAD MEP extended to March 31, 2009
- Recap of AutoCAD-related technologies on Autodesk Labs
- Technology Preview of MEP Analysis Extension extended to 12/31/08
- Autodesk Labs: Forward and Backward utility for AutoCAD
|

Mar 25, 2007
Reply
Hi,
would you tell mi how to create render material with visual lisp in Autocad 2007 or 2008?
Apr 26, 2007
Reply
Dear sir
I am Sudanese ,PhD. student ,my research in the field of computer aided casting design so I want to build software using autocad and visual basic please help and advise me
thank you
Adil
Apr 27, 2007
Reply
Hello Adil,
what for question have you? I have good knowledge of Visual Lisp. I should like to advise …
Jun 9, 2007
Reply
Hi
I haved developed a lisp for extracting text values to a .dat file in just one command. Please mail me if anybody requires this Autolisp Program.
Jun 18, 2007
Reply
Hello Sir,
I am doing a project using vlisp, if u have any dcl files conatining menus and text boxes please mail me as examples.
thanking you sir
with regards
Ramesh
Jan 23, 2008
Reply
Hi I did like to write a vba program that extract ceritan attubute data out of a drawing or drawings and imports them to excel I can do it with eattext command all the time but then I have to create my own headers and titles in excell all the time.
Feb 6, 2008
Reply
how to find point intersection between circle with circle in autolisp programing?
thank you
Feb 8, 2008
Reply
Hi Santo (alias wahyono)
this code is the solution …
;;;—
(vl-load-com)
;;;—
(defun UTL:GET:INTERSECT:LIST ( var / SArray n Lst RetLst pt )
(setq SArray (vlax-variant-value var ))
(setq Lst (vlax-safearray->list SArray ))
(setq n (vlax-safearray-get-l-bound SArray 1 )
RetLst ‘()
)
(while (vla-object e1 ))
(setq o2 (vlax-ename->vla-object e2 ))
(setq rv (vla-IntersectWith o1 o2 acExtendNone ) )
(if rv
(progn
(setq lst (UTL:GET:INTERSECT:LIST rv))
(setq n 0)
(foreach x lst
(mapcar ‘princ (list
“\n” (+ n 1) “. ” “INTERSCTION = ” x ” ” (type x)
))
(setq n (1+ n))
) ) )
(princ)
)
Feb 8, 2008
Reply
Dear sir,
thank for your code to my solution.
i found intersection function between 2 lines only, intersect pt1a pt1b pt2a pt2b, but i am not found intersetion function between circle with circle and circle with line
for example: centerpoint1 radius1 intersection with centerpoint2 radius2 (circle with circle) and centerpoint radius intersection with startpoint endpoint (center with line)
thank you for your attention!
santo
Feb 10, 2008
Reply
Dear Sir,
while (vla-object e1 ), no function definition.
Thank you!
Apr 13, 2008
Reply
Thanks for this information, Please can you guide me to right book to learn Visual Lisp.
May 7, 2008
Reply
can you please give hint how to link autocad programming with C programming language
May 23, 2008
Reply
I am also interested in creating render materials with visual lisp Autocad 2008 or in 2009? Anyone have any ideas?
Jun 26, 2008
Reply
hi!
i need autolisp program wherein, in one autocad file (or maybe there’s a database) that contains instrument names, everytime i changed the instru names, it will automatically update also other autocad files that contain the same name.
sorry, i have no knowledge about programming,kindly explain also.
Aug 2, 2008
Reply
Hello Sir
I am very thanksfull to u if u solve my query.
I have got one drawing from our USA client. In that drawing when i click in model tab its looks normal (i.e layer colur) but when i go to layout its seems all things are black. even i select object and look in property all propertis are normal. Please explain how it works
Jun 13, 2009
Reply
You can configure the layout to print black and white, that’s why every thing turns to black.