dcl help
Instead of selecting the option on the command prompt or typing the value, I would like to use a dcl window with buttons to select scale.
I have never attempted dcl before so am not sure where to start?
I would like 7 buttons for the scale options plus a cancel button.
Thanks for reading...
*****
(defun c:BHP_SCALE-TBLK (/ sc)
(defun *error* (x)
(if ce
(setvar 'cmdecho ce))
(if (eq (strcase x) "*CANCEL*")
(princ "\n cancelled ...."))
(princ)
)
(setq ce (getvar 'cmdecho))
(setvar 'cmdecho 0)
(setq ss (ssget "_X" '((0 . "INSERT") (2 . "BIOA1_v*,LNO_BHPB_A1,NW_BHPB_A1"))))
(setq sc (getreal "\nSpecify scale [1/2/5/10/15/20/25]: "))
(if ss
(progn
(setq blk (vlax-ename->vla-object (ssname ss 0)))
(vlax-put-property blk 'XEffectiveScaleFactor sc)
(vlax-put-property blk 'YEffectiveScaleFactor sc)
(vlax-put-property blk 'ZEffectiveScaleFactor sc)
)
)
(command "Z" "E")
(c:BHP_DIMSTYLE)
(setvar 'cmdecho 1)
(setvar 'cmdecho ce)
(princ)
)
*****
I have never attempted dcl before so am not sure where to start?
I would like 7 buttons for the scale options plus a cancel button.
Thanks for reading...
*****
(defun c:BHP_SCALE-TBLK (/ sc)
(defun *error* (x)
(if ce
(setvar 'cmdecho ce))
(if (eq (strcase x) "*CANCEL*")
(princ "\n cancelled ...."))
(princ)
)
(setq ce (getvar 'cmdecho))
(setvar 'cmdecho 0)
(setq ss (ssget "_X" '((0 . "INSERT") (2 . "BIOA1_v*,LNO_BHPB_A1,NW_BHPB_A1"))))
(setq sc (getreal "\nSpecify scale [1/2/5/10/15/20/25]: "))
(if ss
(progn
(setq blk (vlax-ename->vla-object (ssname ss 0)))
(vlax-put-property blk 'XEffectiveScaleFactor sc)
(vlax-put-property blk 'YEffectiveScaleFactor sc)
(vlax-put-property blk 'ZEffectiveScaleFactor sc)
)
)
(command "Z" "E")
(c:BHP_DIMSTYLE)
(setvar 'cmdecho 1)
(setvar 'cmdecho ce)
(princ)
)
*****
0
Comments
-
Try starting here
web2.airmail.net/terrycad/Tutorials/MyDialogs.htm
for example
Mathias0 -
The site for the tutorials Mathias mentioned has been changed to https://autolisp-exchange.com/0
-
Thanks for that, I will have a look.0
-
Managed to create the dcl.
Just need to incorporate it now.
0 -
This is much easier and you can have say from 2 - 20 buttons. Its a library function so can be used in any code. Example code is at start. I have also included multi toggels and getvals.
There are some more versions like Multi radio buttons 2 & 3 columns.
(if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already
(setq ans (ah:butts 1 "V" '("Pick scale " "10" "25" "50" "100" "200" "250" "500" ))) ; ans holds the button picked value as a string
0 -
Thanks Alan, I will have a look at this option too.0