Author Topic: ask for some help  (Read 2456 times)

0 Members and 1 Guest are viewing this topic.

lc_shi

  • Guest
ask for some help
« on: November 29, 2004, 02:44:05 AM »
Hi Sirs,
     Belowed is a short lisp for adding a box for a text (in a tutorial site),but it can't works, i can't fault these lisp. Pls give me a hand. Thanks
!


Code: [Select]

##
(DEFUN C:TEXT_F ( ) (SETQ OBJ (ENTSEL "\nSelect Text : "))
 (IF (= OBJ NIL) (PRINC "\nNone Object Select") (PROGN
        (SETQ ENT (ENTGET (CAR OBJ)))
        (IF (/= CDR (ASSOC 0 ENT)) "TEXT")
                (PRINC "\nObject Type Error") (PROGN
                (SETQ TEMP (CADR (TEXTBOX (LIST (ASSOC 1 ENT))))
                        TEMP_W (CAR TEMP) TEMP_H (CADR TEMP)
                        PT_BASE (CDR (ASSOC 10 ENT)))
                (COMMAND "PLINE" PT_BASE
                (SETQ PT_TEMP (POLAR PT_BASE 0 TEMP_W))
                (SETQ PT_TEMP (POLAR PT_TEMP (/ PI 2) TEMP_H))
                (SETQ PT_TEMP (POLAR PT_TEMP PI TEMP_W)) "C")
        )     )
 )     )
 (PRINC))

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
ask for some help
« Reply #1 on: November 29, 2004, 03:51:06 AM »
Hi,
The code is missing a left parenthesis in this line:
 (IF (/= CDR (ASSOC 0 ENT)) "TEXT")
change it to:
 (IF (/= (CDR (ASSOC 0 ENT)) "TEXT")  

Although it allows this code to run, the "textbox" function will probably not give you the results you want, without adjusting for rotation angle, obliqueing angle, etc.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
ask for some help
« Reply #2 on: November 29, 2004, 04:00:35 AM »
Beat me by a heartbeat Jeff ..

.. also need to allow for the textsize
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

hyposmurf

  • Guest
ask for some help
« Reply #3 on: November 29, 2004, 03:38:52 PM »
Already been given the answer I know but if you run your original lisp the error you get, suggests you need to look at your parenthesis

; error: extra right paren on input

lc_shi

  • Guest
ask for some help
« Reply #4 on: November 29, 2004, 10:07:51 PM »
i'll try to fix it. it can't works. I doubt it's selected for example.