Jump to content

; error: no function definition: nil


kilari_venkatesh

Recommended Posts

The program is to insert a block everything works fine but after running

in the command prompt it gives " ; error: no function definition: nil "

(DTR) is a function which stores the information in the list format which is provided by the user interface DCL

 

(defun c:getDialogInput (/ input aone )
   (setq input (DTR))
(setq aone (getpoint "\nSelect pickint to insert sheet: "))
(cond				
    ((equal input  '("frptitle" "LIGHT")) progn(
						 (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP"   aone "" ""   0 )
				 )
     					)	
    ((equal input '("fabtitle" "LIGHT"))progn(
					       (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB"   aone "" ""  0 )
														))
    ((equal input '("quotitle" "LIGHT"))progn(
					      (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" ""  0)
					       							))
    	         ( T (princ "Nothing")  )    
 )
 )

Edited by SLW210
Link to comment
Share on other sites

(defun c:getDialogInput ( / input aone )
 (setq input (DTR))
 (setq aone (getpoint "\nSelect pickint to insert sheet: "))
 (cond                
   ( (equal input '("frptitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0)
   )    
   ( (equal input '("fabtitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB" aone "" "" 0)
   )
   ( (equal input '("quotitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" "" 0)
   )
   (T (princ "Nothing")
   )    
 )
)

Link to comment
Share on other sites

The issue is with these expressions:

progn(
(command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0 )
)

 

Since the command function always returns nil, the interpreter will subsequently attempt to evaluate the expression:

(nil)

Resulting in the error 'no function definition: nil'.

Link to comment
Share on other sites

Here is a way to rewrite the function cause I was bored :D

 

(defun c:getDialogInput  (/ input aone f)
 (if
   (and (setq input (DTR))
         (setq f (assoc (car input) '(("frptitle" "LIGHT" "FRP") ("fabtitle" "LIGHT" "FAB") ("quotitle" "LIGHT" "QUO"))))
        (setq aone (getpoint "\nSelect pickint to insert sheet: ")))
    (command "-insert" (strcat "//Mailserver/d/backup/TIT_BLOCK_" (caddr f)) aone ""  "" 0)
    (princ "Nothing")
    )
 (princ)
 )

Link to comment
Share on other sites

(defun c:getDialogInput ( / input aone )
 (setq input (DTR))
 (setq aone (getpoint "\nSelect pickint to insert sheet: "))
 (cond                
   ( (equal input '("frptitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0)
   )    
   ( (equal input '("fabtitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB" aone "" "" 0)
   )
   ( (equal input '("quotitle" "LIGHT"))
     (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" "" 0)
   )
   (T (princ "Nothing")
   )    
 )
)

 

Thanks for clarifying my doubt..:)

Link to comment
Share on other sites

Here is a way to rewrite the function cause I was bored :D

 

(defun c:getDialogInput  (/ input aone f)
 (if
   (and (setq input (DTR))
         (setq f (assoc (car input) '(("frptitle" "LIGHT" "FRP") ("fabtitle" "LIGHT" "FAB") ("quotitle" "LIGHT" "QUO"))))
        (setq aone (getpoint "\nSelect pickint to insert sheet: ")))
    (command "-insert" (strcat "//Mailserver/d/backup/TIT_BLOCK_" (caddr f)) aone ""  "" 0)
    (princ "Nothing")
    )
 (princ)
 )

 

Thanks for giving the advice:D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...