Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Utilizing *error* function, and formatting for DCL

0 REPLIES 0
Reply
Message 1 of 1
Caladbolgll
196 Views, 0 Replies

Utilizing *error* function, and formatting for DCL

To improve the code that I've been working on, I am trying to cause ESC to go back to the menu. 

 

(defun *error* ( errormsg )
  (if (not (member errormsg '("Function cancelled" "quit / exit abort" "Cancel") ) )
    (princ (strcat "\nError: " errormsg) )
    (if ret (Label))
  )
  (princ)
)

In this code, "Label" is the menu function that I'm using, and "ret" is a variable that has value of T except while user is using "Label" function. What I was intending to do is to come back to "Label" function whenever I press ESC unless I was already using it. 

However, this part of the code will only work properly for the first time I pressed ESC. If you press it in anywhere for the second time, it will terminate the macro for good, and I would have to restart the command. When I observed with animated code, on the first time ESC was pressed, it will properly get "terminated" to "*error*" function. However, on the second time, it will immediately exit without calling "*error*".

Are there any way to prevent this from happening?

 

 

 

 

 

Capture.JPG

Another issue I'm troubling with is to format the spacing for this GUI. For these 4 edit_boxes, I'm trying to remove the space between label and the box by restricting height, but it doen't get closer than above. I am very new to DCl, and I don't really know any other ways.

 

Thank you in advance for those people who takes their time to help people like me.

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost