+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    44

    Angry Cannot find definition for dialog

    Registered forum members do not see this ad.

    Can somebody help me this problem?
    I have both the lisp file and the dcl file in the Autocad search path. I have many other lisp & dcl files in the same folder and they all work fine.
    This one is very stubborn. I just can't figure it out.
    The lisp file is called "weld1.lsp" and the dcl file is called "Welds1.dcl"

    Code:
    weld1 : dialog {
          label = "WELD NOTES 1 " ;
          : row {
          label = "WELD SIZE";
          : row {                    
              : edit_box {
                key = "dws";
                label = "WELD SIZE";
                edit_width = 6; 
                alignment = left ;                      
              }
          }
         } 
      ok_cancel ;       
    }

  2. #2
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,227

    Default

    Hi,

    Copy the following in the command line in AutoCAD and let me know what would that returns.
    Code:
    (findfile "Welds1.dcl")

  3. #3
    Senior Member
    Discipline
    Surveying
    dlanorh's Discipline Details
    Occupation
    Geospatial Engineer
    Discipline
    Surveying
    Using
    AutoCAD 2012
    Join Date
    Aug 2017
    Location
    UK/Bundesrepublik Deutschland
    Posts
    113

    Default

    Can't see anything wrong with the dcl file


    Check the lisp file is loading "Welds1.dcl" and loading dialog "weld1". I normally call my dialog the same as the dcl file, otherwise it's easy to make a mistake and nothing appears to happen. Without seeing the lisp code relating to loading and setting the dialog i can't diagnose if there is a problem with the code. I always use the following
    Code:
    (setq d_name (vl-filename-base dcl_name))
        
     (if (not (setq dcl_id (load_dialog dcl_name))) (alert (strcat "Cannot Find DCL file : " dcl_name)))
    
     
     (if (not (new_dialog d_name dcl_id)) (alert (strcat "Cannot Start DCL dialog : " d_name)))
    where dcl_name is the *.dcl file

  4. #4
    Full Member
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    44

    Default

    Code:
    Command: (findfile "Welds1.dcl")
    "C:\\Users\\ynotsbbig\\#advance\\delta tools\\Welds1.dcl"
    Here is the lisp:
    Code:
    (defun C:weld1 (d1 ddiag dcl_id p1)       
       (defun setVars()
          (setq d1 (distof (get_tile "dws"))))           
          (setq dcl_id (load_dialog "Welds1.dcl"))
       (if (not (new_dialog "Welds1" dcl_id))
          (exit)
       )      
          (action_tile "accept" " (setVars)(done_dialog 1)")
          (action_tile "cancel" "(done_dialog 0)")  
          (setq ddiag (start_dialog))
       (if (= ddiag 1)
            (setq p1 (getpoint "\nPick a point "))     
            (command "_line" p1 (polar p1 (deltadtr 0) dws))
       )          
         (unload_dialog dcl_id)
      (princ)
    )

  5. #5
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    Code:
     (new_dialog "Welds1" dcl_id)
    ->
    Code:
     (new_dialog "weld1" dcl_id)

    deltadtr -> defun?


    dws in polar function is d1?
    Last edited by rlx; 14th May 2018 at 06:35 am.

  6. #6
    Senior Member
    Discipline
    Surveying
    dlanorh's Discipline Details
    Occupation
    Geospatial Engineer
    Discipline
    Surveying
    Using
    AutoCAD 2012
    Join Date
    Aug 2017
    Location
    UK/Bundesrepublik Deutschland
    Posts
    113

    Default

    Change your lisp as per rlx or


    Code:
    Welds1 : dialog {
           label = "WELD NOTES 1 " ;
          : row {
          label = "WELD SIZE";
          : row {                    
              : edit_box {
                key = "dws";
                label = "WELD SIZE";
                edit_width = 6; 
                alignment = left ;                      
              }
          }
         } 
      ok_cancel ;       
    }

  7. #7
    Full Member
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    44

    Default

    Ive now renamed both the lisp and the dcl files to "weld1"
    I'm still struggling with it.

    This is the lisp:
    Code:
    (defun C:weld1 (d1 ddiag dcl_id p1)       
       (defun setVars()
          (setq d1 (distof (get_tile "dws"))))           
          (setq dcl_id (load_dialog "weld1.dcl"))
       (if (not (new_dialog "weld1" dcl_id))
          (exit)
       )      
          (action_tile "accept" " (setVars)(done_dialog 1)")
          (action_tile "cancel" "(done_dialog 0)")  
          (setq ddiag (start_dialog))
       (if (= ddiag 1)
            (setq p1 (getpoint "\nPick a point "))     
            (command "_line" p1 (polar p1 (deltadtr 0) d1))
       )          
         (unload_dialog dcl_id)
      (princ)
    )
    This is the dcl:
    Code:
    weld1 : dialog {
          label = "WELD NOTES 1 " ;
          : row {
          label = "WELD SIZE";
          : row {                    
              : edit_box {
                key = "dws";
                label = "WELD SIZE";
                edit_width = 6; 
                alignment = left ;                      
              }
          }
         } 
      ok_cancel ;       
    }

  8. #8
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    Code:
    (defun C:weld1 ( / dcl-fn dcl-fp dcl-id ddiag d1 p1)
      (mk_dia)
      (if (and (setq dcl-id (load_dialog dcl-fn)) (new_dialog "weld1" dcl-id))
        (progn
          (vl-file-delete dcl-fn)
          (action_tile "accept" "(setq d1 (distof (get_tile \"dws\")))(done_dialog 1)")
          (action_tile "cancel" "(done_dialog 0)")
          (setq ddiag (start_dialog))
          (unload_dialog dcl-id)
          (cond
     ((= ddiag 1)
      (setq p1 (getpoint "\nPick a point "))
      (command "_line" p1 (polar p1 (deltadtr 0) d1))); deltadtr = ? , dws = d1?
          )
        )
      )
      (princ)
    )
    (defun deltadtr (i) (if i i 0))
    (defun mk_dia ()
      (if (and (setq dcl-fn (vl-filename-mktemp ".dcl")) (setq dcl-fp (open dcl-fn "w")))
        (mapcar '(lambda (x)(write-line x dcl-fp))
         '("weld1:dialog{label=\"WELD NOTES 1\";:row{label=\"WELD SIZE\";:row {"
           ":edit_box{key=\"dws\";label=\"WELD SIZE\";edit_width=6;alignment=left;}}}ok_cancel;}")))
      (if dcl-fp (close dcl-fp))(gc)
    )
    ;(C:weld1)

  9. #9
    Full Member
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    44

    Default

    Thanks RLX.
    Its obvious to me that you are a lot smarter than me at lisp. The one you sent me works really well.
    In saying that, is it possible to look at my much simpler version because I have many other dcl and lisps that I have written and they are all much the same style.
    I can understand my style as I am familiar with it.
    By the way "deltadtr" is a local lisp I have for Degrees to Radians. It works fine.

    Thanks

  10. #10
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by TunzaGibbo View Post
    Thanks RLX.
    Its obvious to me that you are a lot smarter than me at lisp. The one you sent me works really well.
    In saying that, is it possible to look at my much simpler version because I have many other dcl and lisps that I have written and they are all much the same style.
    I can understand my style as I am familiar with it.
    By the way "deltadtr" is a local lisp I have for Degrees to Radians. It works fine.

    Thanks

    Code:
    (defun c:weld1 ( /  ddiag dcl_id p1 d1)       
      (defun deltadtr (a) (* pi (/ a 180.0)))
      (setq dcl_id (load_dialog (findfile "weld1.dcl")))
      (if (not (new_dialog "weld1" dcl_id))(exit))
      (action_tile "dws" "(setq d1 (distof (get_tile \"dws\")))")
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "cancel" "(done_dialog 0)")  
      (setq ddiag (start_dialog))
      (unload_dialog dcl_id)
      (if (= ddiag 1)
        (progn
          (setq p1 (getpoint "\nPick a point "))
          (command-s "_line" p1 (polar p1 (deltadtr 0) d1))
        )
      )
      (princ)
    )

    think command-s does the trick and action-tile editbox can (should) be
    Code:
     (action_tile "dws" "(setq d1 (distof $value))")
    Last edited by rlx; 14th May 2018 at 10:14 am.

Similar Threads

  1. DCL dialog box that modifies a nested dialog box...
    By sethtriad in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 28th Feb 2013, 01:30 pm
  2. Find and Replace without dialog
    By paulfillion in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 10th Jan 2013, 04:41 pm
  3. Find and replace text without a dialog box
    By y49sides in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 9th Jan 2012, 03:34 pm
  4. FIND command without dialog box?
    By NoelStalker in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 13
    Last Post: 9th Nov 2009, 03:12 pm
  5. Find/Replace text without a dialog box?
    By y49sides in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 11th Jul 2009, 11:43 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts