Jump to content

discussing and explaining one lisp or help needed in understanding


Recommended Posts

Posted

I found this on http://www.afralisp.net/autolisp/tutorials/into-the-database.php AT THE BOTTOM OF PAGE

 

need help in digesting this.

 

(defun c:getlay ( / NAMES SIZ1)
;define funcion

(setvar "cmdecho" 0)
;switch off command echo

	(setq siz1 "0")
;initiliase variable

(setq userclick T)
;set flag

(setq f 1)
;rewind pointer

(while
;start while loop

	  (setq t1 (tblnext "Layer" f)) [color="blue"];; doen't really understand  what it means reseting f.[/color] HELP
  ;get the next layer

  (setq f nil)
  ;reset pointer

  (setq b (cdr (assoc 2 t1)))
  ;get the layer name

    (if (/= b "DEFPOINTS")
    ;if name is not equal to DEFPOINTS

       (setq NAMES (append NAMES (list b)))                      [color="blue"];;;up to know we have not define variable NAMES[/color] HELP
       ;Add the layer name to the list

    );if

);while


[color="silver"]	(setq dcl_id (load_dialog "getlay.dcl"))
;load dialogue

(if (not (new_dialog "getlay" dcl_id)
;check for errors

      );not

     (exit)
     ;if problem exit

);if
 
 (set_tile "sel1" "0")
 ;initilise list box

 (start_list "sel1")
 ;start the list

 (mapcar 'add_list NAMES)
 ;add the layer names

 (end_list)
 ;end the list

   (action_tile

   "cancel"	

   "(done_dialog) (setq userclick nil)"

   );action_tile
   ;if cancel set flag to nil

 (action_tile

   "accept"	

   (strcat	

     "(progn 

       (setq SIZ1 (get_tile \"sel1\"))"	

      " (done_dialog)(setq userclick T))"	

   );strcat

 );action tile
 ;if OK get the layer selected

 (start_dialog)	

 (unload_dialog dcl_id)	

  (if userclick	
  ;if flag true

   (progn

    (setq SIZ1 (nth (atoi SIZ1) NAMES))
    ;get the name of the layer from the list

    (alert (strcat "\nYou Selected Layer  " SIZ1))
    ;display the name
   );end progn

  );end if

(princ)

);defun C:getlay

(princ)

[/color]

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • Qonfire

    12

  • Lee Mac

    6

  • alanjt

    1

  • Lt Dan's legs

    1

Posted

Hello, this is a cylindrical hatch pattern

which code is responsable for hatch gradient color? i did change code 63. for smthg else but nothing happened graphically

 

((-1 . <Entity name: 7ef15f98>) (0 . "HATCH") (330 . <Entity name: 7ef06cf8>) (5 . "A49B") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0 1.0) (2 . "SOLID") (70 . 1) (71 . 1) (91 . 1) (92 . 7) (72 . 0) (73 . 1) (93 . 4) (10 580.208 214.175 0.0) (10 512.05 214.175 0.0) (10 512.05 116.836 0.0) (10 580.208 116.836 0.0) (97 . 1) (330 . <Entity name: 7ef15fa0>) (75 . 0) (76 . 1) (47 . 0.396438) (98 . 1) (10 548.15 179.288 0.0) (450 . 1) (451 . 0) (460 . 0.0) (461 . 0.0) (452 . 1) (462 . 1.0) (453 . 2) (463 . 0.0) [color="red"](63 . 3)[/color] (421 . 16711680) (463 . 1.0) [color="red"]([color="red"]63 . [/color]7[/color]) (421 . 16777215) (470 . "CYLINDER")) 

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