Author Topic: How can i insert random block ?  (Read 3453 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
How can i insert random block ?
« on: April 13, 2011, 03:51:13 AM »
Dear All,
How can i insert random block?

example
tree-1, tree-2 etc.
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

pBe

  • Bull Frog
  • Posts: 402
Re: How can i insert random block ?
« Reply #1 on: April 13, 2011, 06:12:38 AM »
Dear All,
How can i insert random block?

example
tree-1, tree-2 etc.


Your question is too vague. (for me that is)

Sam

  • Bull Frog
  • Posts: 201
Re: How can i insert random block ?
« Reply #2 on: April 13, 2011, 07:09:06 AM »
Dear All,
How can i insert random block?

example
tree-1, tree-2 etc.


Your question is too vague. (for me that is)
Dear sir,
Sorry, my English is poor not more explain
i'm doing presentation work, i will try to insert various type of tree block randomly
1st insert block tree-1 to 10 & again continues insert randomly various block 
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

efernal

  • Bull Frog
  • Posts: 206
Re: How can i insert random block ?
« Reply #3 on: April 13, 2011, 07:22:45 AM »
an attempt to do that...
Code: [Select]
(DEFUN c:brandom (/ prefix pt sufix ssize number block lastblock)
  (SETQ prefix "TREE")
  (WHILE (SETQ pt (GETPOINT "\n-> Insertion point or ENTER for finish : "))
    (SETQ sufix  (RTOS (GETVAR "date") 2 7)
          ssize  (STRLEN sufix)
          number (SUBSTR sufix (- ssize 1))
          block  (ATOI number)
    )
    (IF (<= block 30)
      (PROGN (SETQ block     (STRCAT prefix number)
                   lastblock block
             )
             (ALERT (STRCAT "Insert block " block " goes here"))
      )
      (IF lastblock
        (ALERT (STRCAT "Insert block " lastblock " goes here..."))
        (PRINC "\n-> Try again...")
      )
    )
  )
  (PRINC)
)
;; you must have the blocks TREE0, TREE1, TREE2, TREE..., TREE30
e.fernal

pBe

  • Bull Frog
  • Posts: 402
Re: How can i insert random block ?
« Reply #4 on: April 13, 2011, 07:55:38 AM »
something similar

Code: [Select]
(defun c:test (/ pt)
  (setq
    TreeList
     '("TREE-0" "TREE-1" "TREE-2" "TREE-3" "TREE-4" "TREE-5" "TREE-6"
       "TREE-7" "TREE-8" "TREE-9"
       )
    )
  (while (setq pt (getpoint))
    (command
      "_insert"
      (strcat "TREE-" (substr (rtos (getvar "cdate") 2 8) 17))
      "_non" pt
      ""
      ""
      )
    )
  )

Sam

  • Bull Frog
  • Posts: 201
Re: How can i insert random block ?
« Reply #5 on: April 14, 2011, 01:05:09 AM »
an attempt to do that...
Code: [Select]
(DEFUN c:brandom (/ prefix pt sufix ssize number block lastblock)
  (SETQ prefix "TREE")
  (WHILE (SETQ pt (GETPOINT "\n-> Insertion point or ENTER for finish : "))
    (SETQ sufix  (RTOS (GETVAR "date") 2 7)
          ssize  (STRLEN sufix)
          number (SUBSTR sufix (- ssize 1))
          block  (ATOI number)
    )
    (IF (<= block 30)
      (PROGN (SETQ block     (STRCAT prefix number)
                   lastblock block
             )
             (ALERT (STRCAT "Insert block " block " goes here"))
      )
      (IF lastblock
        (ALERT (STRCAT "Insert block " lastblock " goes here..."))
        (PRINC "\n-> Try again...")
      )
    )
  )
  (PRINC)
)
;; you must have the blocks TREE0, TREE1, TREE2, TREE..., TREE30
dear sir
thx for help
lisp not working, block not insert, place the block in support folder

Command:  BRANDOM
-> Insertion point or ENTER for finish :
-> Try again...
-> Insertion point or ENTER for finish :
-> Insertion point or ENTER for finish :
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

Sam

  • Bull Frog
  • Posts: 201
Re: How can i insert random block ?
« Reply #6 on: April 14, 2011, 01:05:38 AM »
something similar

Code: [Select]
(defun c:test (/ pt)
  (setq
    TreeList
     '("TREE-0" "TREE-1" "TREE-2" "TREE-3" "TREE-4" "TREE-5" "TREE-6"
       "TREE-7" "TREE-8" "TREE-9"
       )
    )
  (while (setq pt (getpoint))
    (command
      "_insert"
      (strcat "TREE-" (substr (rtos (getvar "cdate") 2 8) 17))
      "_non" pt
      ""
      ""
      )
    )
  )
dear sir,
thx for reply
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

efernal

  • Bull Frog
  • Posts: 206
Re: How can i insert random block ?
« Reply #7 on: April 14, 2011, 08:24:23 AM »
must change alerts blocks...
this is a simple example...
e.fernal