Our Friends: Leaflet Printing , Presented by: Talia Cad Software

Sign In

Subscribe

Subscribe to Daily Autocad.


Oct 02
Tuesday
AutoLISP
Difference 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.

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

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

Fig.3
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:25

Post Tags:

17 Responses to “ Difference between AutoLISP and VisualLISP ”
  1. Hi,
    would you tell mi how to create render material with visual lisp in Autocad 2007 or 2008?

  2. Adil M. B. Ahmed

    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

  3. Hello Adil,

    what for question have you? I have good knowledge of Visual Lisp. I should like to advise …

  4. Prasad Loke

    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.

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

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

  7. how to find point intersection between circle with circle in autolisp programing?

    thank you

  8. Muharrem Kocyigit

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

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

  10. Dear Sir,

    while (vla-object e1 ), no function definition.

    Thank you!

  11. Thanks for this information, Please can you guide me to right book to learn Visual Lisp.

  12. can you please give hint how to link autocad programming with C programming language

  13. Stephen Grisez

    May 23, 2008
    Reply

    I am also interested in creating render materials with visual lisp Autocad 2008 or in 2009? Anyone have any ideas?

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

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

  16. You can configure the layout to print black and white, that’s why every thing turns to black.


Post a Comment



All content and source © 2008 Daily Autocad | News Plus wordpress theme brought to you by Zidalgo.