See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Read from LISP in QuickCalc

  1. #1
    Member
    Join Date
    2010-03
    Posts
    8
    Login to Give a bone
    0

    Default Read from LISP in QuickCalc

    Hi,


    I have LISP for drawing function

    (defun mfc (x)
    (+ 0 (* aaa x x x) (* bbb x) ccc)
    )

    (defun drawfc ()
    (command "._pline")
    (while (< start ende)
    (command (list start (mfc start)))
    (setq start (+ start delta))
    )
    (command (list ende (mfc ende)) "")
    )

    (defun c:drawfunc (/ aaa bbb ccc start ende delta)
    (setvar "CMDECHO" 0)
    (setq aaa (getreal "\nvalue a: "))
    (setq bbb (getreal "\nvalue b: "))
    (setq ccc (getreal "\nvalue c: "))
    (setq start (getreal "\nStart value (X): "))
    (setq ende (getreal "\nEnd value (X): "))
    (setq delta (getreal "\nPrecision: "))
    (drawfc)
    (princ)
    )
    How can I read values (aaa bbb ccc) from LISP in QuickCalc? Can I run QC from LISP?

    I would like calculate "y" value for defined "x" value of these function... "x" is value I would like put in command line...

    Thanks in advance...

  2. #2
    Active Member
    Join Date
    2002-12
    Posts
    77
    Login to Give a bone
    0

    Default Re: Read from LISP in QuickCalc

    Quote Originally Posted by b.ssss.12 View Post
    Hi,


    I have LISP for drawing function



    How can I read values (aaa bbb ccc) from LISP in QuickCalc? Can I run QC from LISP?

    I would like calculate "y" value for defined "x" value of these function... "x" is value I would like put in command line...

    Thanks in advance...
    Why are you using quick calc?

  3. #3
    Member
    Join Date
    2010-03
    Posts
    8
    Login to Give a bone
    0

    Default Re: Read from LISP in QuickCalc

    I would like to use quickcalc for calculate "y" values....

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

    Default Re: Read from LISP in QuickCalc

    You can use the direct calculator from AutoCAD which is CAL
    and so on ...

    Regards

    Tharwat

  5. #5
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    1

    Default Re: Read from LISP in QuickCalc

    or you could just do the math with LISP. No need for anything else.

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

    Default Re: Read from LISP in QuickCalc

    exactly .... for example (+ 1 1) = 2

    Regards
    Tharwat313

  7. #7
    Active Member
    Join Date
    2002-12
    Posts
    77
    Login to Give a bone
    0

    Cool Re: Read from LISP in QuickCalc

    Quote Originally Posted by alanjt View Post
    or you could just do the math with LISP. No need for anything else.
    '
    That was my thought, just wasn't sure of his needs.

  8. #8
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Read from LISP in QuickCalc

    Quote Originally Posted by TimSpangler View Post
    '
    That was my thought, just wasn't sure of his needs.
    Nor I.......

  9. #9
    Member
    Join Date
    2010-03
    Posts
    8
    Login to Give a bone
    0

    Default Re: Read from LISP in QuickCalc

    I get LISP

    Code:
    (defun prov (/)
    (setq aaa (getreal "\nvalue a: "))
    (setq bbb (getreal "\nvalue b: "))
    (setq ccc (getreal "\nvalue c: "))
    )
    
    (defun mfc (x)
    (+ 0 (* aaa x x) (* bbb x) ccc)
    )
    
    (defun drawfc ()
    (command "._pline")
    (while (< start ende)
    (command (list start (mfc start)))
    (setq start (+ start delta))
    )
    (command (list ende (mfc ende)) "")
    )
    
    (defun c:drawfunc (/ start ende delta)
    (setvar "CMDECHO" 0)
    (setq start (getreal "\nStart value (X): "))
    (setq ende (getreal "\nEnd value (X): "))
    (setq delta (getreal "\nPrecision: "))
    (prov)
    (drawfc)
    (princ)
    )
    
    (defun C:prov (/ x)
    (setq x (getreal "\nvalue x: "))
    (alert (strcat "rezultat je " (rtos (+ 0 (* aaa x x) (* bbb x) ccc))))
    )
    But I apologize, I would like find minimum of function... Which "x" is for minimum "y"...

  10. #10
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Read from LISP in QuickCalc

    Quote Originally Posted by b.ssss.12 View Post
    But I apologize, I would like find minimum of function... Which "x" is for minimum "y"...
    You could use the min function:
    Code:
    (min 10.2 12.4 6.2 6.3 8.9) ;--> 6.2
    Last edited by irneb; 2010-07-02 at 02:27 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. how to read non-unicode text using lisp?
    By noen.ss in forum AutoLISP
    Replies: 3
    Last Post: 2010-06-19, 10:18 AM
  2. Lisp files can't be read
    By saviersrd in forum AutoLISP
    Replies: 2
    Last Post: 2009-04-21, 04:55 AM
  3. Replies: 9
    Last Post: 2006-11-15, 04:13 PM
  4. Scripts/LISP and read only dwg's
    By mnelson.92099 in forum AutoLISP
    Replies: 3
    Last Post: 2006-08-23, 09:23 AM
  5. script/lisp: read attribute value
    By David van Erk in forum AutoLISP
    Replies: 4
    Last Post: 2006-08-10, 05:02 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
  •