Author Topic: Setting Lineweight within layer creation LISP  (Read 1529 times)

0 Members and 1 Guest are viewing this topic.

npstewart87

  • Mosquito
  • Posts: 9
Setting Lineweight within layer creation LISP
« on: March 29, 2020, 02:09:02 PM »
Good afternoon,

I have several LISP routines created by a former employee and im looking for help to edit one of them. Please note that I have extremely limited ability to code much of anything. This particular routine is to create a revision cloud layer of any name, sets the color, etc. The problem is that the lineweight is far to light and I would like to darken it up so its easier to read. Ideally I would like the lineweight to be "0.010".

The text of the routine is below.


Code - Auto/Visual Lisp: [Select]
  1. (defun D_Cloud_dcl_setup ( / )
  2.   (if (= REV nil) (setq REV "1"))
  3.  
  4.   (setq D_Cloud_dcl_id (load_dialog (strcat PTH8 "D_Cloud.dcl")))
  5.   (if (not (new_dialog "D_Cloud" D_Cloud_dcl_id))
  6.     (exit))
  7.  
  8.   (set_tile "rev_no" REV)
  9.   (action_tile "rev_no" "(setq REV $value)")
  10.  
  11.   (action_tile "accept" "(done_dialog)")
  12.   (action_tile "cancel" "(setq CANCEL_PROG \"1\")")
  13.  
  14.   (unload_dialog D_Cloud_dcl_id)
  15. );end
  16.  
  17. ;;; ************************** Layer for cloud Cloud Program ****************
  18. (defun D_Cloud_Layer ( / )
  19.  
  20.   (setq L_NAME (strcat "G-CLOUD-" REV)
  21.         L_TRI (strcat L_NAME "-TRI"))
  22.  
  23.   (command "-LAYER" "M" L_NAME "C" "100" "" "LT" "CONTINUOUS" "" "")
  24. );end
  25.  
  26. ;;; ************************** Draw Program *********************************
  27. (defun D_Cloud_R_Draw ( / )
  28.   (setvar "OSMODE" 0)
  29.  
  30.   (setq LOWER_PT (getpoint "\nPick cloud lower rectangle point: <None> " ))
  31.   (initget 32)
  32.   (setq UPPER_PT (getcorner LOWER_PT "\nPick cloud upper rectangle point: <None> " ))
  33.   (setq ARC_DIST (* 0.2 (getvar "dimscale" )))        ;;set & adjust arc size
  34.  
  35.   (command "rectangle" "c" 0 0 "e" 0 "f" 0 "t" 0 "w" 0 LOWER_PT UPPER_PT)
  36.  
  37.   (command "_revcloud" "s" "N" "a" ARC_DIST ARC_DIST "o" "last" "N")
  38.  
  39.   (princ "\nClosing cloud...")
  40.  
  41.   (command "-LAYER" "M" L_TRI "C" "161" "" "LT" "CONTINUOUS" "" "")
  42.   (setvar "ATTDIA" 0)
  43.   (setvar "ATTREQ" 1)
  44.   (prompt "\nInsertion point: <None> ")
  45.   (command "_INSERT" (strcat pth1 "Text_Sym_Tri") "SCALE" SB "ROTATE" 0 PAUSE)
  46.   (command REV "")
  47. );end
  48.  
  49.  
  50. ;;; ************************** Main Program *********************************
  51. (defun C:D_Cloud_R ( / LOWER_PT UPPER_PT ARC_DIST )
  52.   (var_in)
  53.   (if (= SB nil)
  54.     (Alert_Msg)
  55.     (progn
  56.       (D_Cloud_dcl_setup)
  57.       (if (/= CANCEL_PROG "1")(D_Cloud_Layer))
  58.       (if (/= CANCEL_PROG "1")(D_Cloud_R_Draw))
  59.     );end_progn
  60.   );end_if
  61.   (var_out)
  62. );end


EDIT (John): Added code tags.
« Last Edit: March 30, 2020, 12:13:33 PM by John Kaul (Se7en) »

Dlanor

  • Bull Frog
  • Posts: 263
Re: Setting Lineweight within layer creation LISP
« Reply #1 on: March 29, 2020, 06:24:25 PM »
Try this. I've commented the lines with the items added to both layers. The lineweight has been set to 0.09mm which was the nearest to your figure of 0.01

Code - Auto/Visual Lisp: [Select]
  1. (defun D_Cloud_dcl_setup ( / )
  2.   (if (= REV nil) (setq REV "1"))
  3.  
  4.   (setq D_Cloud_dcl_id (load_dialog (strcat PTH8 "D_Cloud.dcl")))
  5.   (if (not (new_dialog "D_Cloud" D_Cloud_dcl_id))
  6.     (exit))
  7.  
  8.   (set_tile "rev_no" REV)
  9.   (action_tile "rev_no" "(setq REV $value)")
  10.  
  11.   (action_tile "accept" "(done_dialog)")
  12.   (action_tile "cancel" "(setq CANCEL_PROG \"1\")")
  13.  
  14.   (unload_dialog D_Cloud_dcl_id)
  15. );end
  16.  
  17. ;;; ************************** Layer for cloud Cloud Program ****************
  18. (defun D_Cloud_Layer ( / )
  19.  
  20.   (setq L_NAME (strcat "G-CLOUD-" REV)
  21.         L_TRI (strcat L_NAME "-TRI"))
  22.  
  23.   (command "-LAYER" "M" L_NAME "C" "100" "" "LT" "CONTINUOUS" "" "LW" "0.09" "" "")  ; added  "LW" "0.09" ""
  24. );end
  25.  
  26. ;;; ************************** Draw Program *********************************
  27. (defun D_Cloud_R_Draw ( / )
  28.   (setvar "OSMODE" 0)
  29.  
  30.   (setq LOWER_PT (getpoint "\nPick cloud lower rectangle point: <None> " ))
  31.   (initget 32)
  32.   (setq UPPER_PT (getcorner LOWER_PT "\nPick cloud upper rectangle point: <None> " ))
  33.   (setq ARC_DIST (* 0.2 (getvar "dimscale" )))        ;;set & adjust arc size
  34.  
  35.   (command "rectangle" "c" 0 0 "e" 0 "f" 0 "t" 0 "w" 0 LOWER_PT UPPER_PT)
  36.  
  37.   (command "_revcloud" "s" "N" "a" ARC_DIST ARC_DIST "o" "last" "N")
  38.  
  39.   (princ "\nClosing cloud...")
  40.  
  41.   (command "-LAYER" "M" L_TRI "C" "161" "" "LT" "CONTINUOUS" "" "LW" "0.09" "" "") ; added  "LW" "0.09" ""
  42.   (setvar "ATTDIA" 0)
  43.   (setvar "ATTREQ" 1)
  44.   (prompt "\nInsertion point: <None> ")
  45.   (command "_INSERT" (strcat pth1 "Text_Sym_Tri") "SCALE" SB "ROTATE" 0 PAUSE)
  46.   (command REV "")
  47. );end
  48.  
  49.  
  50. ;;; ************************** Main Program *********************************
  51. (defun C:D_Cloud_R ( / LOWER_PT UPPER_PT ARC_DIST )
  52.   (var_in)
  53.   (if (= SB nil)
  54.     (Alert_Msg)
  55.     (progn
  56.       (D_Cloud_dcl_setup)
  57.       (if (/= CANCEL_PROG "1")(D_Cloud_Layer))
  58.       (if (/= CANCEL_PROG "1")(D_Cloud_R_Draw))
  59.     );end_progn
  60.   );end_if
  61.   (var_out)
  62. );end

npstewart87

  • Mosquito
  • Posts: 9
Re: Setting Lineweight within layer creation LISP
« Reply #2 on: March 30, 2020, 11:49:10 AM »
Thanks so much for the reply!

I just went to try this and it says "Error: extra right paren on input"

Dlanor

  • Bull Frog
  • Posts: 263
Re: Setting Lineweight within layer creation LISP
« Reply #3 on: March 30, 2020, 07:59:15 PM »
I've rechecked the posted code and there is no extra right parentesis. perhaps in one of the referenced sub routines

(var_in), (Alert_Msg) or (var_out)

You may also have missed the first opening paren when copying. I have attached a copy of the file in case this was the problem.