Author Topic: need help finding my error  (Read 2510 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
need help finding my error
« on: February 28, 2008, 11:35:55 AM »
hey guys i was just modifying the dimnote routine and had it working until i decided to abbreviate it from dimnote to dn. i also renamed the lisp and dcl files and now it gives me this message. i know it is something small but can't figure out what i didn't change?

cannot find definition for dialog dn

Code: [Select]
;Tip1566A:  DIMNOTE.LSP   Dimension Notes   (c)1999, Mike Lapinski

(defun DN_SHOWNOTE (/ LNUM LNOTE)
  (set_tile "error" "")
  (setq LNUM  (get_tile "lb_notes")
        LNOTE (nth (atoi LNUM) DM_NOTES)
  ) ;_ end of setq
  (set_tile "eb_note" LNOTE)
  (princ)
) ;_ end of defun
;;======================================================
;; Function: DN_PlaceNote
;; Purpose:  If valid note is input, close dialog box
;;======================================================
(defun DN_PLACENOTE ()
  (set_tile "error" "")
  (setq DN_MODIFIER (strcase (get_tile "eb_note")))
  (if (= DN_MODIFIER " ")
    (set_tile "error" "Invalid note string")
    (done_dialog 1)
  ) ;_ end of if
) ;_ end of defun
;;======================================================
;; Function: DN_AppendNote
;; Purpose:  Append note to selected dimension entity
;;======================================================
(defun DN_APPENDDIM (VAL PLACEMENT / ENT DVAL)
  (setq ENT (car (entsel "\nSelect dimension for note: ")))
  (while (/= "DIMENSION" (cdr (assoc 0 (entget ENT))))
    (princ "\nSelected entity is not a DIMENSION.")
    (setq ENT (car (entsel "\nSelect dimension for note: ")))
  ) ;while
  (setq ENT  (entget ENT)
        DVAL (cdr (assoc 1 ENT))
  ) ;_ end of setq
  (if (= DVAL "")
    (setq DVAL "<>")
  ) ;_ end of if
  (if (= PLACEMENT 1) ;above line
    (setq VAL (strcat DVAL " " VAL))
    (progn
      (if (wcmatch DVAL "*\\X*")
        (setq VAL (strcat DVAL "\\P" VAL))
        (setq VAL (strcat DVAL "\\X" VAL))
      ) ;_ end of if
    ) ;_ end of progn
  ) ;_ end of if
  (entmod (subst (cons 1 VAL) (assoc 1 ENT) ENT))
  (princ)
) ;_ end of defun
;;======================================================
;; Main Function - Dimension NOTE
;;======================================================
(defun C:DN (/ DCL_ID DM_NOTES DN_ABOVE)
  (setq DCL_ID (load_dialog "DN.dcl"))
  (if (not (new_dialog "DN" DCL_ID))
    (exit)
  ) ;_ end of if
  (setq DM_NOTES '("(NOM.)" "(SHELF)" "(TOP)" "(OVERALL)" "(EXACT)"
                  )
        DN_ABOVE 1
  ) ;_ end of setq
  (set_tile "eb_note" "(OVERALL)")
  (set_tile "dn_above" "1") ; Set as default
  (start_list "lb_notes")
  (mapcar 'add_list DM_NOTES)
  (end_list)
  (set_tile "lb_notes" "7")
  (action_tile "lb_notes" "(DN_ShowNote)")
  (action_tile "dn_above" "(setq dn_above 1)")
  (action_tile "accept" "(DN_PlaceNote)")
  (action_tile "cancel" "(done_dialog 0)")
  (if (eq (start_dialog) 1)
    (DN_APPENDDIM DN_MODIFIER DN_ABOVE)
  ) ;_ end of if
  (unload_dialog DCL_ID)
  (princ)
) ;_ end of defun

(princ "Load by typing  DN  ")

ELOQUINTET

  • Guest
Re: need help finding my error
« Reply #1 on: February 28, 2008, 01:50:47 PM »
Hmmm all I did was change the occurances of DN back to Dimnote and it's working again but I don't understand why I can't change this and the filenames to DN and have it work?

Code: [Select]
(defun C:DN (/ DCL_ID DM_NOTES DN_ABOVE)
  (setq DCL_ID (load_dialog "DN.dcl"))
  (if (not (new_dialog "DN" DCL_ID))

Changed it back to this:

Code: [Select]
(defun C:Dimnote (/ DCL_ID DM_NOTES DN_ABOVE)
  (setq DCL_ID (load_dialog "Dimnote.dcl"))
  (if (not (new_dialog "dimnote" DCL_ID))

daron

  • Guest
Re: need help finding my error
« Reply #2 on: February 28, 2008, 01:51:48 PM »
Did you change the name of the .dcl file as well?

ELOQUINTET

  • Guest
Re: need help finding my error
« Reply #3 on: February 28, 2008, 03:01:11 PM »
i did change the dcl name daron. this is not a big deal i just wanted to understand the logic of the whole thing.

daron

  • Guest
Re: need help finding my error
« Reply #4 on: February 28, 2008, 03:15:11 PM »
There must be some internals you're missing then. I haven't worked with dcls in so long, I don't even know where to begin looking.

GDF

  • Water Moccasin
  • Posts: 2081
Re: need help finding my error
« Reply #5 on: February 28, 2008, 03:38:52 PM »
i did change the dcl name daron. this is not a big deal i just wanted to understand the logic of the whole thing.


(if (not (new_dialog "dimnote" DCL_ID))

Did you change the name "dimnote" within the dcl file?
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: need help finding my error
« Reply #6 on: February 28, 2008, 04:43:39 PM »
(if (not (new_dialog "dimnote" DCL_ID))

Did you change the name "dimnote" within the dcl file?

^^ Has my vote!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ELOQUINTET

  • Guest
Re: need help finding my error
« Reply #7 on: February 29, 2008, 10:25:08 AM »
we have a winner. changing the name inside of the dcl did the trick. i didn't know it mattered but apparently it's not a comment like in the lisp, good to know. thanks for your help