Jump to content

Recommended Posts

Posted (edited)

Please gentlemen, I'm in doubt how to call a dcl dialog box in auto lisp and change the color of the buttons. the example is:-
 

; Program to draw any profile through:
; Start point, profile height, profile web thickness
; table width and thickness
(Default c:Beams_Welded ( )
; BEAM VARIABLES
(setq Width (getreal "\nTable Width : ")
                           Thickness_M (getreal "\nTable Thickness : ")
                           Height (getreal "\nProfile height : ")
Thickness_A (getreal "\nProfile soul thickness : ")
; CALCULATIONS
x (- (/ Width 2.00) (/ Thickness_A 2.00))
y (* Thickness_A 0.80)
w (+ (* Thickness_M 1.00) (* y 1.00))
s (- (* Height 1.00) (*w 1.00))
b (- (* Height 1.00) (* Thickness_M 1.00))
z (- (* x 1.00) (* y 1.00))
);end of set 1
;WEIGHT IN KGs PER LINEAR METER
                 ;(setq pm (/ (* Width Thickness_M 2.00 7.85) 1000.00)
                          ; pp (/ (* (- b Thickness_M) Thickness_A 7.85)1000.00)
                           ;pl (+ pm pp)
;); end setq 2
;ORIGIN OF THE DRAWING
(setq pt1 (getpoint "\nOrigin point: "))
; CALCULATIONS OF DRAWING POINTS
(setq pt2 (list (+ (char pt1) Width) (cadr pt1))
pt3 (list (char pt2) (+ (cadr pt1) Thickness_M))
pt4 (list (- (char pt3) z) (cadr pt3))
pt5 (list (- (char pt2) x) (+ (cadr pt3) y))
pt6 (list (char pt5) (+ (cadr pt1) s))
pt7 (list (char pt4) (+ (cadr pt1) b))
pt8 (list (char pt2) (cadr pt7))
pt9 (list (char pt2) (+ (cadr pt1) Height))
pt10 (list (char pt1) (cadr pt9))
pt11 (list (char pt10) (cadr pt8))
pt12 (list (+ (char pt1) z) (cadr pt8))
pt13 (list (+ (char pt1) x) (cadr pt6))
pt14 (list (char pt13) (+ (cadr pt1) w))
pt15 (list (+ (char pt1) z) (cadr pt3))
pt16 (list (char pt11) (cadr pt4))
                           ;pt17(list(+(char pt1)(+ height 20.00)))
);end of Setq 3
; DESIGN
(command pt1 "pline" pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt9 pt10 pt11 pt12 pt13 pt14 pt15 pt16 "c" )
;(command "text" pt17 pl Kgs/M 10 0 line "")
                 ;(draw-text pl "kgs/M" pt17 0 0 8 "standard" 0 "")
                 ;(command "TEXT" "s" CS "0,0" "" "" "") ) ) second text
);end of fun Beams_Welded

 

Edited by CADTutor
Code moved to code block
Posted

Maybe this 

 

(setq Width (getreal "\nTable Width : ")
                           Thickness_M (getreal "\nTable Thickness : ")
                           Height (getreal "\nProfile height : ")
Thickness_A (getreal "\nProfile soul thickness : ")

;;;;;;; My version

(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Table Width" 5 4 "100" "Table Thickness" 5 4 "20" "Profile height" 5 4 "100" "Profile soul thickness" 5 4 "5")))
(setq width (atof (nth 0 ans))
Thickness_M (atof (nth 1 ans))
Height (atof (nth 2 ans))
Thickness_A (atof (nth 3 ans))
)

 

image.png.347cce9ff765c2a98b1e6867fa172863.png

Multi GETVALS.lsp

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