SPIRAL 2D

'morning, I should draw some 2d spirals; with the old Autocad14 I used a FREE good lisp program (see the link below).
Unfortunately I am not able to doing it with my BC platinum V11.
I load the lisp but it does not works.
How to to several type of spirals 2d with BC? Could someone help me?

http://xoomer.virgilio.it/lwcon/curve/spirali.htm

PASTE CODE HERE
PASTE CODE HERE

Comments

  • Hi Olivio,

    The lisp routine has been protected by the author so cannot read the file. I get the following error running on Bricscad.

     

    Punto iniziale: 

    Unable to recognize command "PLINEA". Please try again.
    Invalid window specified.#<<FUNCTION> #x33 @4ca90bfe&gt;

     

    It doesn't work for me as I'm using an English version of Bricscad, so it doesn't recognise the command "PLINEA", which  I assume means "PLINE". If your getting the same error then you would need to either:

    • Go back to the Author and ask them to redo the lisp using international language "PLINEA" -> "._PLINE".
    • Raise a support request to get Bricsys input. Maybe some issue with the file protection, or the way LISP works in this situation.

    Maybe someone else can recommend an alternate spiral routine.

    PASTE CODE HERE

    regards,

    Jason Bourhill

    CAD Concepts

  • Hello,

    I remember that in the older versions of AutoCAD, there used to be a FREE sample routine called SPIRAL.LSP which was un-encrypted as well. If you get hold of an 'old' AutoCAD install (like pre-2004 perhaps), you might be able to re-use that Lisp in Bricscad.

    It is certainly not included in the newer AutoCADs, I just searched that. If I get hold of that sample SPIRAL.LSP, I can send it to you.

    Regards
    Rakesh Rao
    http://rakeshrao.typepad.com

     

     

     

  • Thanks, but I am not solve yet, I fund an other lisp but it does not do.

    ;;;   SPIRAL.LSP
    ;;;   Copyright (C) 1992 by Autodesk, Inc.
    ;;;
    ;;;   Permission to use, copy, modify, and distribute this software
    ;;;   for any purpose and without fee is hereby granted, provided
    ;;;   that the above copyright notice appears in all copies and that
    ;;;   both that copyright notice and this permission notice appear in
    ;;;   all supporting documentation.
    ;;;
    ;;;   THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
    ;;;   WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
    ;;;   PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
    ;;; --------------------------------------------------------------------------;
    ;;; DESCRIPTION
    ;;;
    ;;;   This is a programming example.
    ;;;
    ;;;   Designed and implemented by Kelvin R. Throop in January 1985
    ;;;
    ;;;   This program constructs a spiral. It can be loaded and called
    ;;;   by typing either "spiral", "3dspiral" or the following:
    ;;;   (cspiral <# rotations> <base point> <horiz growth per rotation>
    ;;;            <points per circle> <start radius>
    ;;;            <vert growth per rotation>).
    ;;;
    ;;; --------------------------------------------------------------------------;

    (defun myerror (s)                    ; If an error (such as CTRL-C) occurs
                                          ; while this command is active...
      (if (/= s "Function cancelled")
        (princ (strcat "\nError: " s))
      )
      (setvar "cmdecho" ocmd)             ; Restore saved modes
      (setvar "blipmode" oblp)
      (setq *error* olderr)               ; Restore old *error* handler
      (princ)
    )

    (defun cspiral (ntimes bpoint hfac lppass strad vfac
                    / ang dist tp ainc dhinc dvinc circle dv)

      (setvar "blipmode" 0)               ; turn blipmode off
      (setvar "cmdecho" 0)                ; turn cmdecho off
      (setq circle (* 3.141596235 2))
      (setq ainc (/ circle lppass))
      (setq dhinc (/ hfac lppass))
      (if vfac (setq dvinc (/ vfac lppass)))
      (setq ang 0.0)
      (if vfac
        (setq dist strad dv 0.0)
        (setq dist 0.0)
      )
      (if vfac
        (command "3dpoly")                ; start spiral ...
        (command "pline" bpoint)          ; start spiral from base point and...
      )
      (repeat ntimes
        (repeat lppass
          (setq tp (polar bpoint (setq ang (+ ang ainc))
                          (setq dist (+ dist dhinc))
                   )
          )
          (if vfac
              (setq tp (list (car tp) (cadr tp) (+ dv (caddr tp)))
                    dv (+ dv dvinc)
              )
          )
          (command tp)                    ; continue to the next point...
        )
      )
      (command "")                        ; until done.
      (princ)
    )

  • Olivio:

    What you have is a partial lisp file. Try this link:

    http://www.cadforum.cz/cadforum_en/qaID.asp?tip=835
    File download link:
    http://www.cadstudio.cz/dl_file.asp?ID=143

    3DSPIRAL.LSP also contains a 2D command.

     

  • ;;; This code is the full version of the program. It creates both 2d and 3d spirals.

    ;;; 3DSPIRAL.LSP
    ;     Copyright (C) 1992 by Autodesk, Inc.
    ;
    ;     Permission to use, copy, modify, and distribute this software
    ;     for any purpose and without fee is hereby granted, provided
    ;     that the above copyright notice appears in all copies and that
    ;     both that copyright notice and this permission notice appear in
    ;     all supporting documentation.
    ;
    ;     THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
    ;     WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
    ;     PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
    ;;; --------------------------------------------------------------------------;
    ;;; DESCRIPTION
    ;;;
    ;;;   This is a programming example.
    ;;;
    ;;;   Designed and implemented by Kelvin R. Throop in January 1985
    ;;;
    ;;;   This program constructs a spiral. It can be loaded and called
    ;;;   by typing either "spiral", "3dspiral" or the following:
    ;;;   (cspiral <# rotations> <base point> <horiz growth per rotation>
    ;;;            <points per circle> <start radius>
    ;;;            <vert growth per rotation>).
    ;;;
    ;;; Modifications and support for foreign language versions of CAD
    ;;; by Rakesh Rao, of Four Dimension Technologies, Bangalore-India
    ;;; www.4d-technologies.com
    ;;; --------------------------------------------------------------------------;

    (defun cspiral (ntimes bpoint hfac lppass strad vfac
                    / ang dist tp ainc dhinc dvinc circle dv)

      (setvar "blipmode" 0)               ; turn blipmode off
      (setvar "cmdecho" 0)                ; turn cmdecho off
      (setq circle (* 3.141596235 2))
      (setq ainc (/ circle lppass))
      (setq dhinc (/ hfac lppass))
      (if vfac (setq dvinc (/ vfac lppass)))
      (setq ang 0.0)
      (if vfac
        (setq dist strad dv 0.0)
        (setq dist 0.0)
      )
      (if vfac
        (command "._3dpoly")                ; start spiral ...
        (command "._pline" bpoint)          ; start spiral from base point and...
      )
      (repeat ntimes
        (repeat lppass
          (setq tp (polar bpoint (setq ang (+ ang ainc))
                          (setq dist (+ dist dhinc))
                   )
          )
          (if vfac
              (setq tp (list (car tp) (cadr tp) (+ dv (caddr tp)))
                    dv (+ dv dvinc)
              )
          )
          (command tp)                    ; continue to the next point...
        )
      )
      (command "")                        ; until done.
      (princ)
    )

    ;;;
    ;;;       Interactive spiral generation
    ;;;

    (defun C:SPIRAL (/ olderr ocmd oblp nt bp cf lp)
      ;;;;(setq olderr  *error*
      ;;;;      *error* myerror)
      (setq ocmd (getvar "cmdecho"))
      (setq oblp (getvar "blipmode"))
      (setvar "cmdecho" 0)
      (initget 1)                         ; bp must not be null
      (setq bp (getpoint "\nCenter point: "))
      (initget 7)                         ; nt must not be zero, neg, or null
      (setq nt (getint "\nNumber of rotations: "))
      (initget 3)                         ; cf must not be zero, or null
      (setq cf (getdist "\nGrowth per rotation: "))
      (initget 6)                         ; lp must not be zero or neg
      (setq lp (getint "\nPoints per rotation <30>: "))
      (cond ((null lp) (setq lp 30)))
      (cspiral nt bp cf lp nil nil)
      (setvar "cmdecho" ocmd)
      (setvar "blipmode" oblp)
      (setq *error* olderr)               ; Restore old *error* handler
      (princ)

    )

    ;;;
    ;;;       Interactive spiral generation
    ;;;

    (defun C:3DSPIRAL (/ olderr ocmd oblp nt bp hg vg sr lp)
      (setq ocmd (getvar "cmdecho"))
      (setq oblp (getvar "blipmode"))
      (setvar "cmdecho" 0)
      (initget 1)                         ; bp must not be null
      (setq bp (getpoint "\nCenter point: "))
      (initget 7)                         ; nt must not be zero, neg, or null
      (setq nt (getint "\nNumber of rotations: "))
      (initget 7)                         ; sr must not be zero, neg, or null
      (setq sr (getdist bp "\nStarting radius: "))
      (initget 1)                         ; cf must not be zero, or null
      (setq hg (getdist "\nHorizontal growth per rotation: "))
      (initget 3)                         ; cf must not be zero, or null
      (setq vg (getdist "\nVertical growth per rotation: "))
      (initget 6)                         ; lp must not be zero or neg
      (setq lp (getint "\nPoints per rotation <30>: "))
      (cond ((null lp) (setq lp 30)))
      (cspiral nt bp hg lp sr vg)
      (setvar "cmdecho" ocmd)
      (setvar "blipmode" oblp)
      (princ)
    )

    ;;; --------------------------------------------------------------------------;
    (princ "\nType SPIRAL / 3DSPIRAL to start.")
    (princ)

This discussion has been closed.