Author Topic: Lisp Problem  (Read 3706 times)

0 Members and 1 Guest are viewing this topic.

adrian

  • Guest
Lisp Problem
« on: September 07, 2004, 06:23:54 PM »
Glad to finally find you guys.  I have been looking ever since Cadalog shafted the forum site.
Can anyone tell me what is wrong with the below code.  I am trying to make it easier to cog reinforcing bars in plan, and I found this old lisp.

Code: [Select]
(defun C:COG ( / BAR COGDIR)
(setvar "cmdecho" 0)
(LATEST)
(setq COGDIR (UANGLE 1 "Up Down" "Up Down" NIL NIL))
(cond
 ((= COGDIR "Up")(setq COGANG 90))
 ((= COGDIR "Down")(setq COGANG 270))
)

(setq BAR 0)
    (while
       (setq BAR (entsel "\nSelect BAR:"))
        (if (not (= BAR nil))
            (DRAWCOG)
        );end if
    );end while
(setvar "cmdecho" 1)
(princ)
);end defun

(defun DRAWCOG ( / BANG COGANG2 P1 P2)
      (setq P1 (osnap (cadr BAR) "quick,NEA"))
      (setq P2 (osnap (cadr BAR) "quick,END"))

            (setq BANG (RTD (angle P1 P2)))
            (if (and (> BANG 90)(<= BANG 270))
                (setq BANG (+ BANG 180))
            )
            (setq COGANG2 (+ BANG COGANG))
      (COMMAND "PLINE" P2 (POLAR P2 (dtr COGANG2) 300) "")
      (command "pedit" (entlast) "j" (car bar) "" "X")
);end drawcog


Thanks in advance.

Ron Heigh

  • Guest
Lisp Problem
« Reply #1 on: September 07, 2004, 06:34:55 PM »
looks like there is a defun called LATEST that is missing.

Anonymous

  • Guest
Lisp Problem
« Reply #2 on: September 07, 2004, 06:50:11 PM »
Thanks Ron, but I am a bit of a novice when it comes to lisp files.  I cant seem to find anything relating to the (latest) and was wondering if there was a way to bypass/delete this section to get it to work.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Lisp Problem
« Reply #3 on: September 07, 2004, 06:51:41 PM »
It may be possible to simply comment out the line, but the program may not operate as it is designed to.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Lisp Problem
« Reply #4 on: September 07, 2004, 10:39:50 PM »
adrian,
Looks like you were trying to get this routine to work a year ago. :?

http://www.freecadapps.com/phpbb2/viewtopic.php?t=16106&highlight=cog+bar&sid=091e762cdc5fd04eb87a1d7ac1394576

Although the code has changed some.

What exactly is the routine supposed to do?
Can you post a DWG explaning the before and after?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Crank

  • Water Moccasin
  • Posts: 1503
Lisp Problem
« Reply #5 on: September 09, 2004, 02:59:44 PM »
Quote from: CAB
adrian,
Looks like you were trying to get this routine to work a year ago. :?

http://www.freecadapps.com/phpbb2/viewtopic.php?t=16106&highlight=cog+bar&sid=091e762cdc5fd04eb87a1d7ac1394576
[...]
What exactly is the routine supposed to do?
Can you post a DWG explaning the before and after?


Adrian wrote on Thu Sep 09, 2004 10:55 am:
Quote
[...]All it does is draw a line of set length on the end of another line either up or down depending on user input.  Then makes the whole thing a poly line.
[...]

I don't know what all the arguments are for, but this can't be very difficult.

@Adrian: What is (LATEST) supposed to do? More info please...

BTW: Is this a command used to draw reinforcement?
Vault Professional 2023     +     AEC Collection