Jump to content

A lisp need some modify.


andy_lee

Recommended Posts

Hi friends.

This routine need some modify, I hope you can help me. Thanks.

 

Can only draw type A , I need one more option, type B

 

And, I also need to manually enter the length, Not just choose two points.

Don't need to draw the center line, delete it in routine.

 

(defun c:ttt (/ os bo olay lay col lt e d ctk_Z aa r pt pta ang di ptb pt1 pt2 pt3 pt4 ptt b bl)
 (defun *Error* (msg);
    (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,*EXIT*,")))
        (progn (setvar "blipmode" 0)(princ)))
  );defun *Error*
 (setvar "cmdecho" 0)
 (setq os (getvar "osmode"))
 (setq bo (getvar "blipmode"))
 (setq olay (getvar "clayer"))
 (setvar "osmode" 1023)
 (princ "Long hole")
 (setq lay "centerline")
 (setq col "6")
 (setq lt "CENTER")
 (setq e (getvar 'ltscale))
 (setq d (/ 6 e))
 (if (tblsearch "layer" lay) ""
     (progn
       (command "-layer" "m" lay "color" col "" "l" lt "" "")
       (command "clayer" olay)
     )
 )
  (if *ctk_Z*
    (setq ctk_Z (getdist (strcat "\nPlease enter the diameter <" (rtos *ctk_Z* 2 4) ">:")))
    (setq ctk_Z (getdist "\nPlease enter the diameter <13>:" ))
  )
  (if (not ctk_Z)
    (setq ctk_Z *ctk_Z*)
    (setq *ctk_Z* ctk_Z)
  )
 (setq aa ctk_Z)
 (if (= aa nil) (setq aa (* 6.5 2)))
 (setq r (/ aa 2))
 (while
   (setvar "blipmode" 0)
   (setvar "osmode" 1023)
   (and
      (setq pt (getpoint "\nSpecifies the insertion point:"))
      (setq pta  (getpoint pt "\nSpecifies the other point:"))
    );and
   (setq ang  (angle pt pta)
      di  (distance pt pta)
      ptb (polar pt ang r)
      pt1 (polar ptb (+ ang (/ pi 2)) r)
      pt2 (polar pt1 ang (- di (* r 2)))
      pt3 (polar ptb (+ ang (/ pi -2)) r)
      pt4 (polar pt3 ang (- di (* r 2)))
      ptt (mapcar '(lambda(x)(/ x 2))(mapcar '+ pt pta))
    );set
   (setvar "osmode" 0)
   (command "_.PLINE" "non" pt1 "non" pt2 "A" "non" pt4 "L" "non" pt3 "A" "CL")
   (setq b (* 0.4 r))
   (if (<= di 50)
(setq bl d)
       (setq bl (+ d (* (/ 2 e) (fix (/ di 50)))))
   )
   (command "line" (polar pt (+ ang pi) b) (polar pta ang b) "")
   (command "change" (entlast) "" "P" "la" lay ""
            "change" (entlast) "" "P" "s" bl "")
   (command "line" (polar ptt (+ ang (/ pi 2)) (+ r b)) (polar ptt (- ang (/ pi 2)) (+ r b)) "")
   (command "change" (entlast) "" "P" "la" lay ""
            "change" (entlast) "" "P" "s" bl "")
   (command "redrawall")
   (princ "\n**Continue...**")
   (setvar "osmode" os)
   (setvar "blipmode" bo)
 );while
 (princ)
);defun

Edited by andy_lee
Link to comment
Share on other sites

  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

  • andy_lee

    19

  • hanhphuc

    15

  • BIGAL

    1

Top Posters In This Topic

Posted Images

hi andy

thank you for sharing, should you credit to the author & respect their work? :)

 

so you can d.i.y for your own use

Replace ................ to

(setq
ang (angle pt pta)     --> ang (getangle "\nAngle: ")
di (distance pt pta)  --> di (getdist "\nLength: ")

ptb (polar pt ang r)   --> ptb pt 

 

if don't want drawline anymore, then

put semicolon on left most of the code

;;;    (setq pta  (getpoint pt "\nSpecifies the other point:")) 

;;;    ptt (mapcar '(lambda(x)(/ x 2))(mapcar '+ pt pta))

;;;    (command "line" (polar pt (+ ang pi) b) (polar pta ang b) "")
;;;    ... from
;;;    ...
;;;    ... to
;;;    (command "redrawall")

i apologize d.i.y

 

for type B

(setq 
ang  (getangle "\nAngle: ")  <---- modified
di (getdist "\nLength: ") <---- modified
di ( - di r)   <------------- add this
...
...

Edited by hanhphuc
type B
Link to comment
Share on other sites

hi jason

thank you for sharing, should you credit to the author & respect their work? :)

 

so you can d.i.y for your own use

Replace ................ to

(angle pt pta)     --> (getangle "\nAngle: ")
(distance pt pta)  --> (getdist "\nLength: ")

ptb (polar pt ang r)   --> ptb pt 

 

if don't want drawline anymore, then

put semicolon on left most of the code

;;;    (setq pta  (getpoint pt "\nSpecifies the other point:")) 

;;;    ptt (mapcar '(lambda(x)(/ x 2))(mapcar '+ pt pta))

;;;    (command "line" (polar pt (+ ang pi) b) (polar pta ang b) "")
;;;    ... from
;;;    ...
;;;    ... to
;;;    (command "redrawall")

i apologize can't type B & d.i.y

 

Thanks hanhphuc, After the modification, can't operate normally!

Link to comment
Share on other sites

sorry andy typo error, it should be

(setq 
ang  (getangle "\nAngle: ")  <---- modified
di (getdist "\nLength: ")      <---- modified
[color="red"]di ( - di r) [/color]  <------------- should be this
...
...

Link to comment
Share on other sites

My wish is like this:

1.run command , prompt" Choose the type: end to end(A) or center to center(B) "

2. pick up PT1, Display a line from the PT1 , (Like this routine in my topic)

3. pick up PT2 (Only the Angle is determined)

4. Enter the Length( from PT1)

5. Enter the width

6. OK, done.

 

I forget, when Prompt “Enter the length” , in here, The default value is the length of PT1 to PT2 , I can Enter other value or directly to confirm.

Edited by andy_lee
Link to comment
Share on other sites

You could add a IF when asking for length, if you press Enter length is nil then it will ask for two pts and return length. Same with width, or have a default preset value again press enter or a 0 for two pts

Link to comment
Share on other sites

My wish is like this:

1.run command , prompt" Choose the type: end to end(A) or center to center(B) "

2. pick up PT1, Display a line from the PT1 , (Like this routine in my topic)

3. pick up PT2 (Only the Angle is determined)

4. Enter the Length( from PT1)

5. Enter the width

6. OK, done.

I forget, when Prompt “Enter the length” , in here, The default value is the length of PT1 to PT2 , I can Enter other value or directly to confirm.

Link to comment
Share on other sites

Filletbox

argument

From & to = point

radi = double, filletrad

mod = Boolean, t / nil

hp# 26/07/14
(defun fbox (From to radi mod / ang dist p1 p2 p3 p4 lst en)
 (if (and From to radi) ;_ end of and
   (setq ang   (angle From to)
  From (if mod
     From
     (polar From (+ ang pi) radi)
     ) ;_ end of if
  dist   (distance From to)
  dist   (if mod
     dist
     (+ dist radi)
     ) ;_ end of if
  p1   (polar From (- ang (/ pi 2.)) radi)
  p2   (polar p1 ang dist)
  p3   (polar p2 (+ ang (/ pi 2.)) (* radi 2.))
  p4   (polar p3 (+ ang pi) dist)
  lst   (mapcar ''((p) (reverse (cdr (reverse p)))) (list p1 p2 p3 p4))
  en   (entmakex
     (append (mapcar 'cons
       '(0 100 100 90 70 210)
       (list "LWPOLYLINE" "AcDbEntity" "AcDbPolyline" (length lst) 1 '(0. 0. 1.))
       ) ;_ end of mapcar
      (mapcar ''((x) (cons 10 (trans x 1 0))) lst)
      ) ;_ end of append
     ) ;_ end of entmakex
  ) ;_ end of setq
   ) ;_ end of if
 (setvar "filletrad" radi )
 (vl-cmdf "Fillet" "p" en) <---- sorry.. command for lazy coder
 en
 ) ;_ end of defun

Link to comment
Share on other sites

Example: *can both pick drawing or key in

 

Pick Point or [Options] ? : ;

Length?

Width?

Angle?

 

---------------------------------------------------------------------------

Pick Point or [Options] ? : o

Point from [Centre / Edge]? : e

Select mode [A / B]? : B

Pick Point or [Options] ? :

Length?

Width?

Angle?

 

(setq *key* "A"
     *pos* "Centre"
     ) ;_ end of setq

(defun c:TEST (/ *error* var oldvar p q Len Wid angl)
 
 (defun *error* (msg )
   (if	(not (wcmatch (strcase msg) "*CANCEL*,*EXIT*"))
     (princ (strcat "\nError: " msg))
     ) ;_ end of if
   (mapcar 'setvar var oldvar )
   (princ)
   ) ;_ end of defun
 
(setq oldvar (mapcar 'getvar
(setq var
 '("cmdecho" "angbase" "angdir" ))))
 
(mapcar 'setvar var '(0 0.0 0) )
 
 (prompt "\nOptions: Centre & Egde | mode A: point to point & mode B: centre to centre")
 (setq p T)
 (while (or (not (listp p)) (= p nil))
   (initget "Options")
   (setq p (getpoint (strcat "\nPick Point or [Options] <" *pos* "/mode " *key* "> ? : ")))
   (if	(= p "Options")
     (setq *pos* (UKWORD 1 "Centre Edge" "\nPoint from [Centre / Edge]? " *pos*)
    *key* (UKWORD 1 "A B" "\nSelect mode [A / B]? " *key*)
    ) ;_ end of setq
     ) ;_ end of if
   ) ;_ end of while
 (and (setq Len (if (= *pos* "Centre")
	   (getdist "\nLength? ")
	   (getdist p "\nLength? ")
	   ) ;_ end of if
     ) ;_ end of setq
      (setq Wid (getdist "\nWidth? "))
      (setq angl (getangle p "\nAngle? "))
      (setq q (if (= *pos* "Centre")
	 (polar p (- angl pi) (/ len 2.))
	 p
	 ) ;_ end of if
     ) ;_ end of setq
      
      (setq e (fbox q
	     (polar q angl len)
	     (/ wid 2.)
	     (if (= *key* "A")
	       T
	       nil
	       ) ;_ end of if
	     ) ;_ end of fbox
     ) ;_ end of setq
      ) ;_ end of and
 
 (mapcar 'setvar var oldvar )
 (princ)
 ) ;_ end of defun



;;;-------------------------------------------------------------------
;; This function is freeware courtesy of the author's of "Inside AutoLisp"
;; for rel. 10 published by New Riders Publications.  This credit must
;; accompany all copies of this function.
;;* UKWORD User key word. DEF, if any, must match one of the KWD strings
;;* BIT (1 for no null, 0 for none) and KWD key word ("" for none) are same as
;;* for INITGET. MSG is the prompt string, to which a default string is added
;;* as <DEF> (nil or "" for none), and a : is added.
;;*
(defun UKWORD (bit kwd msg def / inp)
 (if (and def (/= def ""))
   (setq msg (strcat "\n" msg " <" def "> : ")
         bit (* 2 (fix (/ bit 2)))
         )                             ;setq
   )                                   ;if
 (initget bit kwd)
 (setq inp (getkword msg))
 (if inp inp def)
 )                                     ;defun

Link to comment
Share on other sites

Example: *can both pick drawing or key in

 

Pick Point or [Options] ? : ;

Length?

Width?

Angle?

 

---------------------------------------------------------------------------

Pick Point or [Options] ? : o

Point from [Centre / Edge]? : e

Select mode [A / B]? : B

Pick Point or [Options] ? :

Length?

Width?

Angle?

 

 

Hi ! hanhphuc ,This is the final version? I will try!

Link to comment
Share on other sites

Example: *can both pick drawing or key in

 

 

Hi hanhphuc,

Use a period of time, not very convenient. Enter --"O" Choose "A" &"B" ,It is easy to go wrong.

Can use the DCL? like this:

TEST.png

 

I have already made SLD files:

SLD.zip

Link to comment
Share on other sites

Hi hanhphuc,

Use a period of time, not very convenient. Enter --"O" Choose "A" &"B" ,It is easy to go wrong.

Can use the DCL?

 

 

actually you don't need to enter "options" every time for "A or B", the "option" value you enter will be set as default for the next typical sessions, so you just pick point without "options" anymore..

Pick Point or [Options] <[color="red"]Centre/mode A[/color]> ?

in red are default value

same as dcl, you only call it when you need to change its settings, not every time run it pops up then not user friendly :)

Link to comment
Share on other sites

actually you don't need to enter "options" every time for "A or B", the "option" value you enter will be set as default for the next typical sessions, so you just pick point without "options" anymore..

Pick Point or [Options] <[color="red"]Centre/mode A[/color]> ?

in red are default value

same as dcl, you only call it when you need to change its settings, not every time run it pops up then not user friendly :)

 

Yes, not every time run it pops up then not user friendly, but Dcl more intuitive.

Link to comment
Share on other sites

Yes, not every time run it pops up then not user friendly, but Dcl more intuitive.

 

 

http://www.cadtutor.net/forum/showthread.php?87818-A-lisp-need-some-modify./page2


 (if (null *fb_user*)
   (setq *fb_user* (mapcar 'itoa '(1 0 1 0)))
   ) ;_ end of if

(defun fbdia (/ radio dcl_id path dcl)
 (setq	radio '("radio1" "radio2" "radioA" "radioB" )
path  (getenv "temp")
)
 
 ('((f lst /)
    (setq f (open f "w"))
    (mapcar ''(($) (write-line $ f)) lst)
    (close f)
    (setq f nil)
    )
   (setq dcl (strcat path "\\tmp.dcl"))
   '("icon_fbox_img : image {"
     "        color                   = 0;"
     "        width                   = 40;"
     "        aspect_ratio            = 0.75;"
     "        allow_accept            = true;"
     "        fixed_height            = true;"
     "        fixed_width             = true;"
     "}"
     ""
     ""
     "fbox: dialog {"
     "\tlabel=\"Fillet Box settings\";"
     "        key = \"dcl_title\";"
     ""
     ": paragraph{"
     "        : text_part{"
     "\tlabel =\"Choose options \";"
     "\t//alignment = centered;"
     "}"
     "  }      "
     "        :column {"
     "                :row { "
     "                    :column {"
    
     "                      :icon_fbox_img {key = \"SH-CENTRE\";}"
     "                    }"
     "                    :column {             "
     
     "                      :icon_fbox_img {key = \"SH-EDGE\";}"
     "                    }"
     "                 }"
     "}"
     " :column{fixed_width=true;//alignment=centered;"
     " :boxed_radio_row{label=\"Draw method\";"
     "\t:radio_button{label=\"Pick centre                                         \";key=\"[color="red"]radio1[/color]\";}//value=\"0\";"
     "        :radio_button{label=\"Pick side                                       \";key=\"[color="red"]radio2[/color]\";}//value=\"1\""
     "}"
     "}"
     "           :column {"
     "                 :row { "
     "                    :column {"
     
     "                      :icon_fbox_img {key = \"SH-P2P\";}"
     "                    } "
     "                    :column {"
     
     "                      :icon_fbox_img {key = \"SH-C2C\";}"
     "                    }"
     "                 } "
     "        }"
     "        "
     "        spacer_1;"
     " :column{fixed_width=true;//alignment=centered;"
     " :boxed_radio_row{label=\"Mode\";"
     "           :radio_button{label=\"A:Edge to Edge                                 \";key=\"[color="red"]radioA[/color]\";}//value=\"0\""
     "           :radio_button{label=\"B:Radii to radii                               \";key=\"[color="red"]radioB[/color]\";}//value=\"1\";"
     "           }"
     "}"
     "        :column{fixed_width=true;alignment=centered;"
     "        : paragraph{"
     "        : text_part{"
     "\tlabel =\"Fillet box : hanhphuc 2014\";"
     "\talignment = centered;"
     "}"
     "  }      "
     "        :row {"
     " \t  spacer_0;"
     "           ok_cancel;"
     "        }"
     "}"
     "}"
     )
   )

 (setq dcl_id (load_dialog dcl))
 (new_dialog "fbox" dcl_id)
 (mapcar ''((a)
     ('((i sld)
	(setq x (dimx_tile i))
	(setq y (dimy_tile i))
	(start_image i)
	(fill_image 0 0 x y -2)
	(slide_image 0 0 x y sld)
	(end_image)
	)
      a
      (strcat [color="red"]path "\\"[/color] a) ; <---------------- [color="red"]change your slide path here ; example: (strcat "C:\\hp\\" a )[/color]
      )
     )
  sld
  ) ;_ end of mapcar
 
(if
  *fb_user* 
   (mapcar 'set_tile
    radio
    (setq *fb_user* (apply 'append
			   (list 
				 (if (= *pos* "Centre")
				   '("1" "0")
				   '("0" "1")
				   ) ;_ end of if

				 (if (= *key* "A")
				   '("1" "0")
				   '("0" "1")
				   ) ;_ end of if
				 ) ;_ end of list
			   ) ;_ end of apply
	  ) ;_ end of setq
    ) ;_ end of mapcar
   ) ;_ end of if 
 
(setq        
      *fb_user*
(mapcar ''((k a b) (action_tile k (strcat "(setq " a " \"" b "\" )")))
		 radio
		 '("*pos*" "*pos*" "*key*" "*key*")
		 '("Centre" "Edge" "A" "B")
		 ) ;_ end of mapcar
      ) ;_ end of setq

 
 (action_tile "accept" "(setq *fb_user* (mapcar 'get_tile radio))
 (alert (strcat 
  \"\nmethod: \"*pos* \"\nmode: \" *key* \"\n\"(vl-princ-to-string *fb_user*)))(done_dialog)")

 (start_dialog)
 
 (unload_dialog dcl_id)
 (princ)
 ) ;_ end of defun

;note: no *error* handler & lambda not optimized, just for debug

 

Try modify the main struture code (previous post), starts from if statement..

remove the prompt input UKWORD & UKREAL


(if	(= p "Options")
     (progn [b][color="red"](fbdia)[/color][/b] (setq p nil))
[color="silver"];;;      (setq *pos* (UKWORD 1 "Centre Edge" "\nPoint from [Centre / Edge]? " *pos*)[/color]
[color="silver"];;;	    *key* (UKWORD 1 "A B" "\nSelect mode [A / B]? " *key*)
;;;	    ) ;_ end of setq[/color]
     ) ;_ end of if

Edited by hanhphuc
radioA radioB radio1 radio2
Link to comment
Share on other sites


Try modify the main struture code (previous post), starts from if statement..
remove the prompt input UKWORD & UKREAL

[/quote]

[b]This?[/b]

[code]  (if (null *fb_user*)
   (setq *fb_user* (mapcar 'itoa '(1 0 1 0)))
   ) ;_ end of if

(defun fbdia (/ radio dcl_id path dcl)
 (setq	radio '("radio1" "radio2" "radioA" "radioB" )
path  (getenv "temp")
)
 
 ('((f lst /)
    (setq f (open f "w"))
    (mapcar ''(($) (write-line $ f)) lst)
    (close f)
    (setq f nil)
    )
   (setq dcl (strcat path "\\tmp.dcl"))
   '("icon_fbox_img : image {"
     "        color                   = 0;"
     "        width                   = 40;"
     "        aspect_ratio            = 0.75;"
     "        allow_accept            = true;"
     "        fixed_height            = true;"
     "        fixed_width             = true;"
     "}"
     ""
     ""
     "fbox: dialog {"
     "\tlabel=\"Fillet Box settings\";"
     "        key = \"dcl_title\";"
     ""
     ": paragraph{"
     "        : text_part{"
     "\tlabel =\"Choose options \";"
     "\t//alignment = centered;"
     "}"
     "  }      "
     "        :column {"
     "                :row { "
     "                    :column {"
    
     "                      :icon_fbox_img {key = \"SH-CENTRE\";}"
     "                    }"
     "                    :column {             "
     
     "                      :icon_fbox_img {key = \"SH-EDGE\";}"
     "                    }"
     "                 }"
     "}"
     " :column{fixed_width=true;//alignment=centered;"
     " :boxed_radio_row{label=\"Draw method\";"
     "\t:radio_button{label=\"Pick centre                                         \";key=\"radio1\";}//value=\"0\";"
     "        :radio_button{label=\"Pick side                                       \";key=\"radio2\";}//value=\"1\""
     "}"
     "}"
     "           :column {"
     "                 :row { "
     "                    :column {"
     
     "                      :icon_fbox_img {key = \"SH-P2P\";}"
     "                    } "
     "                    :column {"
     
     "                      :icon_fbox_img {key = \"SH-C2C\";}"
     "                    }"
     "                 } "
     "        }"
     "        "
     "        spacer_1;"
     " :column{fixed_width=true;//alignment=centered;"
     " :boxed_radio_row{label=\"Mode\";"
     "           :radio_button{label=\"A:Edge to Edge                                 \";key=\"radioA\";}//value=\"0\""
     "           :radio_button{label=\"B:Radii to radii                               \";key=\"radioB\";}//value=\"1\";"
     "           }"
     "}"
     "        :column{fixed_width=true;alignment=centered;"
     "        : paragraph{"
     "        : text_part{"
     "\tlabel =\"Fillet box : hanhphuc 2014\";"
     "\talignment = centered;"
     "}"
     "  }      "
     "        :row {"
     " \t  spacer_0;"
     "           ok_cancel;"
     "        }"
     "}"
     "}"
     )
   )

 (setq dcl_id (load_dialog dcl))
 (new_dialog "fbox" dcl_id)
 (mapcar ''((a)
     ('((i sld)
	(setq x (dimx_tile i))
	(setq y (dimy_tile i))
	(start_image i)
	(fill_image 0 0 x y -2)
	(slide_image 0 0 x y sld)
	(end_image)
	)
      a
      (strcat path "\\" a) ; <---------------- change your slide path here ; example: (strcat "C:\\hp\\" a )
      )
     )
  sld
  ) ;_ end of mapcar
 
(if
  *fb_user* 
   (mapcar 'set_tile
    radio
    (setq *fb_user* (apply 'append
			   (list 
				 (if (= *pos* "Centre")
				   '("1" "0")
				   '("0" "1")
				   ) ;_ end of if

				 (if (= *key* "A")
				   '("1" "0")
				   '("0" "1")
				   ) ;_ end of if
				 ) ;_ end of list
			   ) ;_ end of apply
	  ) ;_ end of setq
    ) ;_ end of mapcar
   ) ;_ end of if 
 
(setq        
      *fb_user*
(mapcar ''((k a b) (action_tile k (strcat "(setq " a " \"" b "\" )")))
		 radio
		 '("*pos*" "*pos*" "*key*" "*key*")
		 '("Centre" "Edge" "A" "B")
		 ) ;_ end of mapcar
      ) ;_ end of setq

 
 (action_tile "accept" "(setq *fb_user* (mapcar 'get_tile radio))
 (alert (strcat 
  \"\nmethod: \"*pos* \"\nmode: \" *key* \"\n\"(vl-princ-to-string *fb_user*)))(done_dialog)")

 (start_dialog)
 
 (unload_dialog dcl_id)
 (princ)
 ) ;_ end of defun

(setq *key* "A"
     *pos* "Centre"
     ) ;_ end of setq

(defun c:TEST (/ *error* var oldvar p q Len Wid angl)
 
 (defun *error* (msg )
   (if	(not (wcmatch (strcase msg) "*CANCEL*,*EXIT*"))
     (princ (strcat "\nError: " msg))
     ) ;_ end of if
   (mapcar 'setvar var oldvar )
   (princ)
   ) ;_ end of defun
 
(setq oldvar (mapcar 'getvar
(setq var
 '("cmdecho" "angbase" "angdir" ))))
 
(mapcar 'setvar var '(0 0.0 0) )
 
 (prompt "\nOptions: Centre & Egde | mode A: point to point & mode B: centre to centre")
 (setq p T)
 (while (or (not (listp p)) (= p nil))
   (initget "Options")
   (setq p (getpoint (strcat "\nPick Point or [Options] <" *pos* "/mode " *key* "> ? : ")))
[color="red"](if	(= p "Options")
     (progn (fbdia) (setq p nil))
;;;      (setq *pos* (UKWORD 1 "Centre Edge" "\nPoint from [Centre / Edge]? " *pos*)
;;;	    *key* (UKWORD 1 "A B" "\nSelect mode [A / B]? " *key*)
;;;	    ) ;_ end of setq
     ) ;_ end of if[/color]
   ) ;_ end of while
 (and (setq Len (if (= *pos* "Centre")
	   (getdist "\nLength? ")
	   (getdist p "\nLength? ")
	   ) ;_ end of if
     ) ;_ end of setq
      (setq Wid (getdist "\nWidth? "))
      (setq angl (getangle p "\nAngle? "))
      (setq q (if (= *pos* "Centre")
	 (polar p (- angl pi) (/ len 2.))
	 p
	 ) ;_ end of if
     ) ;_ end of setq
      
      (setq e (fbox q
	     (polar q angl len)
	     (/ wid 2.)
	     (if (= *key* "A")
	       T
	       nil
	       ) ;_ end of if
	     ) ;_ end of fbox
     ) ;_ end of setq
      ) ;_ end of and
 
 (mapcar 'setvar var oldvar )
 (princ)
 ) ;_ end of defun

;;;-------------------------------------------------------------------
;; This function is freeware courtesy of the author's of "Inside AutoLisp"
;; for rel. 10 published by New Riders Publications.  This credit must
;; accompany all copies of this function.
;;* UKWORD User key word. DEF, if any, must match one of the KWD strings
;;* BIT (1 for no null, 0 for none) and KWD key word ("" for none) are same as
;;* for INITGET. MSG is the prompt string, to which a default string is added
;;* as <DEF> (nil or "" for none), and a : is added.
;;*
(defun UKWORD (bit kwd msg def / inp)
 (if (and def (/= def ""))
   (setq msg (strcat "\n" msg " <" def "> : ")
         bit (* 2 (fix (/ bit 2)))
         )                             ;setq
   )                                   ;if
 (initget bit kwd)
 (setq inp (getkword msg))
 (if inp inp def)
 )                                     ;defun

 

 

radio1 & radio2 &radioA &radioB is what ?

 

Need change the slide path ? The sld file and lisp file at the same folder .How to modify it ? .

Link to comment
Share on other sites

This?

YES :)

 

 

radio1 & radio2 &radioA &radioB is the sld name ? and need change the slide path .

radio is key name, not sld name. you just need changing the path! never change the slide name!!

Link to comment
Share on other sites

This?

 

radio1 & radio2 &radioA &radioB is what ?

 

Need change the slide path ? The sld file and lisp file at the same folder .How to modify it ? .

the slide must be put in support folder, or create it. or try to put in short name path, ie: "C:\\LISP\\"

Link to comment
Share on other sites

the slide must be put in support folder, or create it.

 

Thank you ,my friend ,

 

I put sld file and lisp in support folder, the same folder , How to modify the path?

Link to comment
Share on other sites

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