Jump to content

command line input change to DCL dialog


nalsur8

Recommended Posts

here coding command line input

can help me to change using DCL dialog

 

ballon_slot_img.png

 

(defun c:bll (/ a b c d num pt ds lg p1 p2 ang p3 ht cd p4 pt5)
 ;;    Tharwat 26. Jan. 2014        ;;
 ;; edited by nalsur8 11/02/2014
 ;;===== add 12022014 ======
 (setq os (getvar "osmode"))
 (setvar "osmode" 512)
 (if (not job#)
   (setq job# (getstring "\nJob Number :"))
   (setq job# job#)
 )					;if

 (if (= (setq ds (getvar "dimscale")) 0.0)
   (setq ds 1.)
 )
 (setq lg (+ (* ds (getvar "dimasz")) 3))

 (if (not num)
   (setq num (getint "\n Starting Item #: "))
   (setq num num)
 )					;if
 (setq split (getstring "\nSaparate Plate? Y,N :"))
 (if (= split "Y")
   (progn
     (initget 1 "A B C D")
     (setq plate# (getkword "Plate A,B,C,D <A>:"))
   )					;progn
   (setq plate# "")
 )					;if
 (while (and (setq p1 (getpoint "\n Leader Start Point: "))
      (setq p2 (getpoint p1 "\n Leader Ending Point: "))
 )

   (if	(< num 10)
     (setq num1 "-0")
     (setq num1 "-")
   )
   (setq ang (angle p1 (list (car p2) (cadr p1))))
   (setq p3 (polar p2 ang lg))
   (setq ht (* ds (getvar "dimtxt")))
   (setq cd (/ (* (getvar "dimtxt") ds) 0.4))
   (setq p4 (polar p3 ang (/ cd 2.)))

   (command "_.leader"	"_none"	p1 "_none" p2 "_none" p3 "" "" "n")
   (setq a (polar p4 (+ ang (* pi 0.5)) (/ cd 2.)))
   (setq b (polar a ang 52.))		;(distance p2 p3))); change long slot
   (setq c (polar b (+ ang (* pi 1.5)) cd))
   (setq d (polar c (+ pi ang) 52.))	;(distance p2 p3))); change long slot

   (entmakex (list '(0 . "LWPOLYLINE")
	    '(100 . "AcDbEntity")
	    '(100 . "AcDbPolyline")
	    '(90 . 4)
	    '(70 . 1)
	    (cons 10 a)
	    (cons 10 b)
	    '(42 . -1)
	    (cons 10 c)
	    (cons 10 d)
	    '(42 . -1)
      )
   )
;;;       (command "circle" p4 "d" 3"");p=============
   (entmakex
     (list
'(0 . "TEXT")
(cons 10
      (setq pt (mapcar '(lambda (p q) (/ (+ p q) 2.))
		       (mapcar '(lambda (p q) (/ (+ p q) 2.)) a b)
		       (mapcar '(lambda (p q) (/ (+ p q) 2.)) d c)
	       )
      )
)
(cons 11 pt)
(cons 40 ht)
(cons 1 (strcat job# num1 (itoa num) plate#))
				;edit here for text
(cons 50 0.)
'(41 . 1.0)
(cons 7 (getvar 'textstyle))
'(71 . 0)
'(72 . 4)
'(73 . 0)
     )
   )
   (setq num (+ num 1))
 )					;while
 (setq plate# nil)
;;;  );if
 (princ)
 (setvar "osmode" os)
)

 

DCL

ballon_slot : dialog{
label="Ballon Slot";
:row{
:boxed_column{label="Setting";
:column{
fixed_width=true;
:row{
:text{label="Job Number (Prefix)";}
:edit_box{key="jobno";fixed_width=true;}
}
:row{
:text{label="Plate Stage (Suffix)";}
:toggle{key="?????";}
:edit_box{key="suffix";fixed_width=true;}
}
:row{
:text{label="Start No";}
:edit_box{key="start_no";fixed_width=true;}
}
}
}
:column{
:button{label="OK";key="accept";is_default=true;}
:button{label="Cancel";key="cancel";is_cancel=true;}
:text{}
:text{}
:text{}
:text{}
}
}
}

Edited by nalsur8
editing code format
Link to comment
Share on other sites

Nalsur8, please edit your post to format properly the code; seems that it lost its new lines when pasted here, so appear as a single line. One looking to help you will have to first take care to split the code in its original statements.

Link to comment
Share on other sites

  • 4 weeks later...

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