See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Lisp routine doesnt work properly

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2015-03
    Posts
    1
    Login to Give a bone
    0

    Default Lisp routine doesnt work properly

    Dear friends:

    I'm a begginer. I've made a small rutine that draws a cone and some circles over it. But, some cases it works well, but, in other cases, the circles are not drawed correctly. The "pendiente" is the slope of the cone. When the slope is low, the circles are drawed all in the same plane.

    (defun c:cono ()
    (setq v (getpoint "\nVertice:"))
    (setq p (getreal "\nIngrese la pendiente %:"))
    (setq r 400)
    (setq a (* r (/ p 100)))
    (setq p1 (list (car v) (cadr v) (- (caddr v) a)))
    (command "cone" p1 r a)
    (setq j a)
    (while (> j 0)
    (setq z (- (caddr v) j))
    (setq p2 (list (car v) (cadr v) z))
    (command "circle" p2 (/ j (/ p 100)))
    (setq j (- j 1))
    )
    )


    Please someone help me.

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    1

    Default Re: Lisp routine doesnt work properly

    Hi,
    Try to add the "_none" before the coordinate points p1 & p2 to ignore current settings of your AutoCAD OSNAPS.

  3. #3
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp routine doesnt work properly

    Prueba con esto , la variable OSMODE , indica los modos de snap , puesta en 0 , significa "_none"

    OSMODE (System Variable)

    Sets running object snaps.

    Type: Bitcode
    Saved in: Registry
    Initial value: 4133
    The setting is stored as a bitcode using the sum of the following values:

    Value
    Description
    0 NONe
    1 ENDpoint
    2 MIDpoint
    4 CENter
    8 NODe
    16 QUAdrant
    32 INTersection
    64 INSertion
    128 PERpendicular
    256 TANgent
    512 NEArest
    1024 Geometric CEnter
    2048 APParent Intersection
    4096 EXTension
    8192 PARallel
    16384 Suppresses the current running object snaps
    To specify more than one running object snap, enter the sum of their values. For example, entering 3 specifies the Endpoint (bitcode 1) and Midpoint (bitcode 2) object snaps.

    Note: Developers creating custom routines can use the 16384 bitcode to temporarily suppress the current running object snap settings without losing the original settings.


    Code:
    (defun c:cono ()
    (setq v (getpoint "\nVertice:"))
    (setq p (getreal "\nIngrese la pendiente %:"))
    
    ;;;(setq v (list 0 0 0))
    ;;;(setq p 100)
      
    (setq r 400)
    (setq a (* r (/ p 100)))
    (setq p1 (list (car v) (cadr v) (- (caddr v) a)))
    (setq osmode (getvar 'osmode)); get osmode
    (setvar 'osmode 0)  ;set osmode to 0 , no snap
    (command "cone" p1 r a)
    (setq j a)
    (while (> j 0)
    (setq z (- (caddr v) j))
    (setq p2 (list (car v) (cadr v) z))
    (command "circle" p2 (/ j (/ p 100)))
    (setq j (- j 1))
    )
    (setvar 'osmode osmode); reset to original osmode   
    )

Similar Threads

  1. Getting my lisp routine to work in C3D 2015
    By dmackey.143011 in forum AutoLISP
    Replies: 5
    Last Post: 2015-04-06, 07:22 AM
  2. Lisp routine doesn't work
    By boyerd492098 in forum AutoLISP
    Replies: 16
    Last Post: 2015-01-27, 10:13 PM
  3. Help command doesnt work
    By aganske226653 in forum ACA General
    Replies: 0
    Last Post: 2010-11-22, 06:13 PM
  4. Replies: 4
    Last Post: 2007-06-06, 07:59 PM
  5. Replies: 6
    Last Post: 2007-04-27, 05:54 PM

Posting Permissions

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