Jump to content

one function calling another


korg

Recommended Posts

what string tells one defun to call another?

 

(defun norm()

(if(= opt7 T)

(command "-plot" "N" "" "normal" "" "no" "yes" ""(command "zoom" "e"))

(ELSE LOAD NORM2)))

 

 

 

norm is a button inside a dialog, if opt7 = nil then load the next dialog named norm2

Link to comment
Share on other sites

Hey Krod,

 

By dialog boxes, do Norm & Norm2 use DCL files?

 

The If statement should be able to handle the both options

 

(defun norm()

   ;if the value for opt7 is not nil
   (if opt7 

 ;==== Positive test result ====
 ;;progn is requied if you wish to carry out
 ;;multiple commands for a positive or negative if
 (progn 
 (command "-plot" ...)
 (command "zoom" "e")
 )

 ;==== Negative test result ====
 ;;Run "norm2" is opt7 is nil
 (norm2)
 )
 )

 

what string tells one defun to call another?

 

When you define a function using the (defun norm ()...) the symbol naming the function, in this case "norm" can be called from another function by enclosing it in brackets

 

;==== Negative test result ====

;;Run "norm2" is opt7 is nil

(norm2)

 

In the above sample the routine norm2 is run from inside the function norm

 

Hope this is makes some sense

 

Jammie

Link to comment
Share on other sites

yes they use a dcl file. here is the lisp, it locks up autocad when I run it and select "plot normal" button. should I search for the page set-up inside the norm function?

qpt4.LSP

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...