[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


Hello all, I'm trying to use the routine below but...

<< Back to: comp.cad.autocad AutoLISP FAQ (part 1/2) - general

Question by gigi7
Submitted on 3/29/2004
Related FAQ: comp.cad.autocad AutoLISP FAQ (part 1/2) - general
Rating: Not yet rated Rate this question: Vote
Hello all,
I'm trying to use the routine below but something goes bad. I load the command without errors but when I try to call the command SEG2CIR from Autocad prompt an "unknown command" message returns.
What can I do?
Luigi

;;; converts a bulged segment (bulge pt1 pt2) of a polyline
  ;;;   to a circle (ctr rad), the start- and endpoints are known
  ;;;   therefore the angles too: (angle ctr pt1)(angle ctr pt2)
  ;;; returns nil on a straight segment!
  ;;; (bugfixed version. Thanks to Sergei Komarov)
  (defun SEG2CIR (seg / bulge p1 p2 cot x y rad dummy)
    (if (zerop (car seg))  ;straight line => invalid circle
      nil
      (setq bulge (car seg) p1 (cadr seg) p2 (caddr seg)
        cot (* 0.5 (- (/ 1.0 bulge) bulge))
        x (/ (- (+ (car  p1) (car  p2))
                (* (- (cadr p2) (cadr p1)) cot)) 2.0)
        y (/ (+ (+ (cadr p1) (cadr p2))
                (* (- (car  p2) (car  p1)) cot)) 2.0)
        rad (distance (list (car p1) (cadr p1)) (list x y))
        dummy (list (list x y) rad))))   ; return this, I hate progn's


Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: comp.cad.autocad AutoLISP FAQ (part 1/2) - general


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.