+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2012
    Posts
    100

    Default Re-entering Lisp

    Registered forum members do not see this ad.

    When I run a rouitine containing the following line I get the above message:
    Code:
     
    (setq ip(car (reverse lx)))
    (setq pr(polar ip devx 400))
    (command "_line" "_non" ip "_non" pr "")
    (setq x(getpoint "\nGive nearest point to ip on curve"))
    (setq del(abs b))
    (setq a(/ del 2))
    The value of devx has been calculaed by the routine previously.
    It happens after the line has been drawn. What seems to be the problem?. The routine, hovever,goes on to evaluate the renainder and do what I need to do as intended. Also how can I show the values of variables such as minimum Radius, superelevation, lenght of spiral etc. all calculated for varius positions of x (as per local standards) in a table before I finally accept its position on the line?.
    I shall be grateful for any help.

  2. #2
    Senior Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2012
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    328

    Default

    In shown example nothing seems to point on re-entering lisp error...

    If you want to make sure that (command) function has exit insert this line after (command "_line" "_non" ip "_non" pr)
    Code:
    (while (> (getvar 'cmdactive) 0) (command ""))

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  3. #3
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2012
    Posts
    100

    Default

    Hi Marko_redar,
    Thanks for the reply. It however does not work. Try it yourself with asigned values for lx and devx as follows:
    Code:
     
    (setq lx '((500 500)))
    (setq devx 1.0)
    (setq b 1)
    (setq ip(car (reverse lx)))
    (setq pr(polar ip devx 400))
    (command "_line" "_non" ip "_non" pr "")
    (while (> (getvar 'cmdactive) 0) (command ""))
    (setq x(getpoint "\nGive nearest point to ip on curve"))
    (setq del(abs b))
    (setq a(/ del 2))
    You need to set appropriate limits (say 0,0 and 1000, 900)

  4. #4
    Senior Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2012
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    328

    Default

    You have to put your code inside function defined as command or non-command - my example is command function X

    Code:
    (defun c:x nil
    (setq lx '((500 500)))
    (setq devx 1.0)
    (setq b 1)
    (setq ip(car (reverse lx)))
    (setq pr(polar ip devx 400))
    (command "_line" "_non" ip "_non" pr)
    (while (> (getvar 'cmdactive) 0) (command ""))
    (setq x (getpoint "\nGive nearest point to ip on curve"))
    (setq del (abs b))
    (setq a (/ del 2))
    )
    Now, paste code or load it with appload, and type X to execute... There is no error message...

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  5. #5
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2012
    Posts
    100

    Default

    Thanks marko it works.
    Now I want it to work inside my code without having to type x.
    Regards

  6. #6
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2012
    Posts
    100

    Default

    Registered forum members do not see this ad.

    Hi Marko,
    Thanks again, it works inside the routine.
    Regards

Similar Threads

  1. Plot current layout without entering name is lisp plot string
    By hosannabizarre in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 8th Apr 2011, 01:43 pm
  2. edit text after entering it
    By iamlegend in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 3rd Feb 2009, 05:54 pm
  3. entering lines...
    By jimmie in forum AutoCAD 3D Modelling & Rendering
    Replies: 13
    Last Post: 10th Jun 2008, 11:42 am
  4. Entering fractional units
    By skate in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 14th Jan 2005, 04:14 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts