Author Topic: error when loaded  (Read 3949 times)

0 Members and 1 Guest are viewing this topic.

danny

  • Guest
error when loaded
« on: March 11, 2005, 01:53:25 PM »
I created my own list of routines using PDJ's format from this post
http://theswamp.org/phpBB2/viewtopic.php?t=3023&highlight=autoload
I'm getting and error message on load
Code: [Select]
error: misplaced dot on input
here's what I got
Code: [Select]
(DEFUN C:DICTIONARY ()
      (TEXTSCR)
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n========================   DICTIONARY   ==========================")
      (Prompt "\n==============   LIST OF ROUTINES AND FUNCTION   =================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n==================================================================")
      (Prompt "\n                                                                  ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=========================AREA ROUTINES============================")
      (Prompt "\n                                                                  ")
      (Prompt "\n ACRE....gives the area of selected objects in acre's             ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=========================BLOCK ROUTINES===========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n BN......inserts name of selected block in text                   ")
      (Prompt "\n IMP.....converts selected objects to a block with base points 0,0")
      (Prompt "\n IRT.....insert and rotate block                                  ")
      (Prompt "\n ROM.....rotate multiple blocks and or text by its base point     ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=======================DIMENSION ROUTINES=========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n DIMABL..inserts aligned dimension on A-Anno-Dims layer           ")
      (Prompt "\n DIMLBL..inserts linear dimension on A-Anno-Dims layer            ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=========================LAYER ROUTINES===========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n LFA.....freeze all layers                                        ")
      (Prompt "\n                                                                  ")

(setq temp (getstring "\nPress Enter to Continue:                                 "))
      (Prompt "\n========================LINTYPE ROUTINES==========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n BATT....changes linetype of selected object to batting           ")
      (Prompt "\n BRDR....changes linetype of selected objects to border           ")
      (Prompt "\n BRDR2...changes linetype of selected objects to border 2         ")
      (Prompt "\n BRDRX2..changes linetype of selected objects to borderx2         ")
      (Prompt "\n BYLR....changes linetype of selected objects to bylayer          ")
      (Prompt "\n CNTR....changes linetype of selected objects to center           ")
      (Prompt "\n CNTR2...changes linetype of selected objects to center2          ")
      (Prompt "\n CNTRX2..changes linetype of selected objects to centerx2         ")
      (Prompt "\n CONT....changes linetype of selected objects to continuous       ")
      (Prompt "\n DOT.....changes linetype of selected objects to dot              ")
      (Prompt "\n DOT2....changes linetype of selected objects to dot2             ")
      (Prompt "\n DOTX2...changes linetype of selected objects to dotx2            ")
      (Prompt "\n DSH.....changes linetype of selected objects to dashed           ")
      (Prompt "\n DSH2....changes linetype of selected objects to dashed2          ")
      (Prompt "\n DSHX2...changes linetype of selected objects to dashedx2         ")
      (Prompt "\n DSHDT...changes linetype of selected objects to dashdot          ")
      (Prompt "\n DSHDT2..changes linetype of selected objects to dashdot2         ")
      (Prompt "\n DSHDTX2.changes linetype of selected objects to dashdotx2        ")
      (Prompt "\n DVD.....changes linetype of selected objects to divide           ")
      (Prompt "\n DVD2....changes linetype of selected objects to divide2          ")
      (Prompt "\n DVDX2...changes linetype of selected objects to dividex2         ")
      (Prompt "\n HID.....changes linetype of selected objects to hidden           ")
      (Prompt "\n HID2....changes linetype of selected objects to hidden2          ")
      (Prompt "\n HIDX2...changes linetype of selected objects to hiddenx2         ")
      (Prompt "\n PHTM....changes linetype of selected objects to phantom          ")
      (Prompt "\n PHTM2...changes linetype of selected objects to phantom2         ")
      (Prompt "\n PHTMX2..changes linetype of selected objects to phantomx2        ")
      (Prompt "\n                                                                  ")

(setq temp (getstring "\nPress Enter to Continue:                                 "))
      (Prompt "\n=======================PLOTTING ROUTINES==========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n PSI2234.loads all page setups for AHL sheet size 22x34           ")
      (Prompt "\n PSI3042.loads all page setups for AHL sheet size 30X42           ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=======================SETTINGS ROUTINES==========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n CSET....lists settings of the current drawing                    ")
      (Prompt "\n OPENBAK.opens backup files                                       ")
      (Prompt "\n OSM.....Danny's Osnap default settings                           ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=======================SHORTCUT ROUTINES==========================")
      (Prompt "\n                                                                  ")
      (Prompt "\n ADD.....add numerical text for a total                           ")
      (Prompt "\n ADDL....adds length of selected lines for a total                ")
      (Prompt "\n ARA.....array objects at an angle                                ")
      (Prompt "\n ARAD....array an object equally between two selected points      ")
      (Prompt "\n CB......copy from base point                                     ")
      (Prompt "\n CC".....change diameter of selected circle                       ")
      (Prompt "\n CD......draws circle by diameter                                 ")
      (Prompt "\n CHC.....change color of selected objects                         ")
      (Prompt "\n CM......copy multiple                                            ")
      (Prompt "\n COORD...get coordinates of a certain point                       ")
      (Prompt "\n CR......copy then rotate                                         ")
      (Prompt "\n DETAIL..CopY all objects within a circled portion of your drawing")
      (Prompt "\n DTR.....trims everything between two selected lines              ")
      (Prompt "\n EE......erases objects when selected                             ")
      (Prompt "\n EL......erases last object                                       ")
      (Prompt "\n EXD.....extend using fence option                                ")
      (Prompt "\n FIT.....arrays an object, w  defined spacing, between two points ")
      (Prompt "\n JPL.....joins selected lines to a polyline                       ")
      (Prompt "\n LM......draws a line from the mid of 2 selected points           ")
      (Prompt "\n LPER....draws a line perpendicular from a selected line          ")
      (Prompt "\n MR......move then rotate                                         ")
      (Prompt "\n OM......offset multiple similar to array                         ")
      (Prompt "\n TCOORD..Insert coordinates of a point in text                    ")
      (Prompt "\n TRM.....trim using fence option                                  ")
      (Prompt "\n VPL.....draws limits of pspace viewport in mspace                ")
      (Prompt "\n                                                                  ")

(setq temp (getstring "\nPress Enter to Continue:                                 "))
      (Prompt "\n=========================TEXT ROUTINES============================")
      (Prompt "\n                                                                  ")
      (Prompt "\n ADDT....adds numerical text for a total                          ")
      (Prompt "\n ATX.....align text                                               ")
      (Prompt "\n chtxt...change text properties individually or globally          ")
      (Prompt "\n CTHT....changes text height                                      ")
      (Prompt "\n CTST....change text style                                        ")
      (Prompt "\n MT......multiline text on A-Anno-Text layer                      ")
      (Prompt "\n SCM.....scale multiple blocks and text by its base point         ")
      (Prompt "\n TBRA....add brackets to text                                     ")
      (Prompt "\n TF......flip text                                                ")
      (Prompt "\n TPAR....add parenthesis to text                                  ")
      (Prompt "\n TROT....rotate text parallel to a line                           ")
      (Prompt "\n TUL.....underline text                                           ")
      (Prompt "\n                                                                  ")
      (Prompt "\n=========================UCS ROUTINES=============================")
      (Prompt "\n                                                                  ")
      (Prompt "\n 0.......snap crosshairs to 0                                     ")
      (Prompt "\n 1.......snap crosshairs to 1                                     ")
      (Prompt "\n 5.......snap crosshairs to 5                                     ")
      (Prompt "\n 10......snap crosshairs to 10                                    ")
      (Prompt "\n 15......snap crosshairs to 15                                    ")
      (Prompt "\n 18......snap crosshairs to 18                                    ")
      (Prompt "\n 20......snap crosshairs to 20                                    ")
      (Prompt "\n 25......snap crosshairs to 25                                    ")
      (Prompt "\n 27......snap crosshairs to 27                                    ")
      (Prompt "\n 30......snap crosshairs to 30                                    ")
      (Prompt "\n 35......snap crosshairs to 35                                    ")
      (Prompt "\n 40......snap crosshairs to 40                                    ")
      (Prompt "\n 45......snap crosshairs to 45                                    ")
      (Prompt "\n 50......snap crosshairs to 50                                    ")
      (Prompt "\n 55......snap crosshairs to 55                                    ")
      (Prompt "\n 60......snap crosshairs to 60                                    ")
      (Prompt "\n 65......snap crosshairs to 65                                    ")
      (Prompt "\n 70......snap crosshairs to 70                                    ")
      (Prompt "\n 75......snap crosshairs to 75                                    ")
      (Prompt "\n SA......snap crosshairs to a given angle or pick line to align w ")

(setq temp (getstring "\nPress Enter to Return:                                   "))
      (graphscr)
   )                                  
(princ)

Can't seem to understand where I went wrong.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
error when loaded
« Reply #1 on: March 11, 2005, 03:01:18 PM »
This line:
      (Prompt "\n CC".....change diameter of selected circle                       ")

Has a " where it doesn't belong....

JimWebster

  • Guest
error when loaded
« Reply #2 on: March 11, 2005, 03:10:06 PM »
Danny,

That is slick!!

I would be very interested in these two Lisp routines, if you have the time:

TF......flip text
TROT....rotate text parallel to a line

danny

  • Guest
error when loaded
« Reply #3 on: March 11, 2005, 03:27:05 PM »
:oops: Thanks Jeff..
Jim,
have a look in the lilly pond under danny
 http://www.theswamp.org/lilly_pond

JimWebster

  • Guest
error when loaded
« Reply #4 on: March 11, 2005, 03:39:58 PM »
Danny,

Thank you!!! :)  :)  :)

JimWebster

  • Guest
error when loaded
« Reply #5 on: March 11, 2005, 03:53:19 PM »
Danny,

Couldn't email you directly, so.......
(I am using AutoCAD 2005.)

TF.lsp
Generates error: no function definition: UKWORD

TROT.lsp
Generates error on load: malformed list on input
Then on execution: no function definition: TUSV

danny

  • Guest
error when loaded
« Reply #6 on: March 11, 2005, 04:29:30 PM »
sorry....I got cut short
add this to both
Code: [Select]
(defun ukword (bit kwd msg def / inp)
  (if (and def (/= def ""))
    (setq msg (strcat "\n" msg "<" def ">: ")
 bit (* 2 (fix (/ bit 2)))
    )
    (if (= " " (substr msg (strlen msg) 1))
      (setq msg (strcat "\n" (substr msg 1 (1- (strlen msg))) ": "))
      (setq msg (strcat "\n" msg ": "))
    )
  )
  (initget bit kwd)
  (setq inp (getkword msg))
  (if inp
    inp
    def
  )
)
(defun r2d (r) (* (/ r pi) 180.0))
(defun d2r (d) (/ (* d pi) 180.0))
(defun tusv ()
  (setq bm (getvar "blipmode"))
  (setq ce (getvar "cmdecho"))
  (setq oe *error*
*error* tuerr
  )
  (setvar "blipmode" 0)
  (setvar "cmdecho" 0)
  (command ".UNDO" "M")
  (graphscr)
)
(defun turv ()
  (setvar "blipmode" bm)
  (setvar "cmdecho" ce)
  (setq *error* oe
oe nil
  )
  (princ)
)
(defun tuerr (s)
  (if (/= s "Function Cancelled")
    (princ (strcat "\nError: " s))
  )
  (command ".UNDO" "E")
  (setvar "blipmode" bm)
  (setvar "cmdecho" ce)
  ;;(setvar "aunits" au)
  (graphscr)
  (setq *error* oe
oe nil
  )
  (princ)
)
(princ)

JimWebster

  • Guest
error when loaded
« Reply #7 on: March 14, 2005, 01:47:57 PM »
Danny,

TF now works fine, but TROT is still generating errors.
Maybe it would be best to re-upload TROT.LSP to the Lily Pond.
And whenever you have the time, as well!!!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
error when loaded
« Reply #8 on: March 14, 2005, 02:00:58 PM »
Please don't misinterpret this as flaming, but when using functions written by others it's polite, if not a legal requirement to include authorship. If I'm not mistaken "New Rider's Publications" published the ukword function included above in one of their "Customizing AutoCAD" books. Admittedly many years ago, but still, better to err on the side of conservatism.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JimWebster

  • Guest
error when loaded
« Reply #9 on: March 17, 2005, 06:22:15 PM »
Note that I have come across a Lisp rountine for TROT.

Go here http://www.llpsite.com/freeware.htm and almost at the bottom of the page
there is a file download called aligntxt.zip. And the routine works like a charm!!!
By default the routine flips the text clockwise, but at the end of the routine there is
an option that allows you to flip the selected text 180 degrees (counter-clockwise).