Jump to content

Recommended Posts

Posted
I wonder which variant to OP will go with :D

 

If I were him, I'd go with the talking one - and install it on every PC in his workplace :P :P

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    13

  • ronjonp

    10

  • alanjt

    9

  • wizman

    6

Top Posters In This Topic

Posted

>.>

 

<.>

 

Why not choose all? :3

 

(defun c:tm( / choice)
 (setq choice (getrandint 0 23))
 (cond
   ((= choice 1)    (c:tm1))
   ((= choice 2)    (c:tm2))
   ((= choice 3)    (c:tm3))
   ((= choice 4)    (c:tm4))
   ((= choice 5)    (c:tm5))
   ((= choice 6)    (c:tm6))
   ((= choice 7)    (c:tm7))
   ((= choice     (c:tm8))
   ((= choice 9)    (c:tm9))
   ((= choice 10)    (c:tm10))
   ((= choice 11)    (c:tm11))
   ((= choice 12)    (c:tm12))
   ((= choice 13)    (c:tm13))
   ((= choice 14)    (c:tm14))
   ((= choice 15)    (c:tm15))
   ((= choice 16)    (c:tm16))
   ((= choice 17)    (c:tm17))
   ((= choice 18)    (c:tm18))
   ((= choice 19)    (c:tm19))
   ((= choice 20)    (c:tm20))
   ((= choice 21)    (c:tm21))
   ((= choice 22)    (c:tm22))
   ((= choice 23)    (c:tm23))
   ((= choice 24)    (c:tm24))
   )
 )

(defun rand( / modulus multiplier increment random)
 (if (not seed)
   (setq seed (getvar "DATE"))
 )
 (setq modulus    65536
       multiplier 25173
       increment  13849
       seed  (rem (+ (* multiplier seed) increment) modulus)
       random     (/ seed modulus)
 )
)

(defun getrandint(in ax / )
 (fix (* (rand) (- (1+ ax) in)))
 )

(defun c:tm1( / )
 (setvar 'tilemode
         (if (zerop (getvar 'tilemode))
           1
           0
         )
 )
 (princ)
)

(defun c:tm2( / )
 (setvar 'tilemode
         (- 1 (getvar 'tilemode))
 )
 (princ)
)

(defun c:tm3( / )
 (setvar 'tilemode (boole 6 1 (getvar 'tilemode)))
 (princ)
)

(defun c:tm4( / )
(if (eq (getvar 'tilemode) 1)
  (setvar 'tilemode 0)
  (setvar 'tilemode 1)
)
(princ)
)

(defun c:tm5( / )
 (or (and (zerop (getvar 'tilemode))
          (setvar 'tilemode 1))
     (setvar 'tilemode 0))
 (princ))

(defun c:tm6( / spc doc)
 (vl-load-com)
 (setq spc (vlax-get (setq doc (vlax-get (vlax-get-acad-object) 'activedocument))
                     'activespace
           )
 )
 (vlax-put doc 'activespace (- 1 spc))
 (princ)
)

(defun c:tm7( / )
 (cond ((zerop (getvar 'tilemode))
        (setvar 'tilemode 1))
       (T (setvar 'tilemode 0)))
 (princ))

(defun c:tm8( / )
 (if (member (getvar "ctab") (layoutlist))
   (setvar "ctab" "Model")
   (setvar "ctab" (nth 0 (layoutlist)))
   )
 )

(defun c:tm9( / )
 (if (member (getvar "ctab") (layoutlist))
   (setvar "ctab" "Model")
   (command "layout" "set" (nth 0 (layoutlist)))
   )
 )

(defun c:tm10( / )
 (setvar 'tilemode (nth (getvar 'tilemode) '(1 0)))
 (princ)
)

(defun c:tm11( / tabnum)
 (vl-load-com)
 (setq tabnum(vlax-get-property (vlax-invoke-method (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'ActiveDocument) 'Layouts) 'Item 1) 'Name))
 (setvar "ctab" tabnum)
      )

(defun c:tm12( / )
 (vl-load-com)
 (setvar 'TILEMODE
         (rem
           (- 1
             (getvar 'TILEMODE))
               (rem
                 (car
                   (vl-string->list "TILEMODE")) 86)))
 (princ))

(defun c:tm13( / )
 (setvar 'tilemode (lsh 1 (- (getvar 'tilemode))))
 (princ)
)

(defun c:tm14( / )
 (setvar 'tilemode (fix (cos (getvar 'tilemode))))
 (princ)
 )

(defun c:tm15( / )
 (if (= (getvar 'ctab) "Model")
   (setvar 'ctab (car (layoutlist)))
   (setvar 'ctab "Model")
 )
)

(defun c:tm16( / )
(if (vl-position (getvar 'ctab) (layoutlist))
(setvar 'tilemode 1)
(setvar 'tilemode 0)
)
)

(defun c:tm17( / )
 (setvar 'tilemode (- 2 (expt 2 (getvar 'tilemode))))
 (princ)
)

(defun c:tm18( / )
(eval (list 'setvar "tilemode" (abs (1- (getvar 'tilemode)))))
(princ)
)

(defun c:tm19( / )
(eval (list 'setvar "tilemode" (1- (getvar 'tilemode))))
(princ)
)

(defun c:tm20( / )
 (vla-SendCommand
   (vla-get-ActiveDocument
     (vlax-get-acad-object)
   ) ;_ vla-get-ActiveDocument
   (strcat "(setvar 'tilemode "
           (itoa (1- (getvar 'tilemode)))
           ") "
   ) ;_ strcat
 ) ;_ vla-SendCommand
 (princ)
) ;_ defun

(defun c:tm21( / )
 (setvar 'tilemode (distance '(1 0 0)
           (list  (getvar 'tilemode) 0 0)))
 (princ)
)

(defun c:tm22( / )
 (vl-load-com)
 (vlax-invoke
   (vlax-create-object "Sapi.SpVoice") "Speak"
   (vl-list->string
     (append '(84 105 108 101 109 111 100 101
               32 115 101 116 32 116 111 32)
             (list
               (ascii
                 (itoa
                   (setvar 'tilemode
                           (- 1 (getvar 'tilemode))))))))
   0)
 (princ))

(defun c:tm23( / )
 (setvar 'tilemode (1+ (- (getvar 'tilemode)))) 
 (princ)
)

(defun c:tm24( / )
 (apply 'setvar (list 'tilemode (- 1 (getvar 'tilemode))))
 )

... *runs away*

Posted

one big happy toggle family.

Posted
one big happy toggle family.

 

 

:lol:.. lol...:lol:

Posted

Thanks everyone for their nice programming skill.

But I like to want something different programming. I want to move the tab from Model tab to layout tab if the position of the tab is in model tab but if the tab is in the position in layout tab it does not need to move from layout tab to model tab. The tab have to stay in the layout position.

 

the programmings are posted are moving from model tab to layout tab and layout tab to model tab.

 

if u can it will be great

thanks of all programmer again

Posted

Thanks everyone for their nice programming skill.

But I like to want something different programming. I want to move the tab from Model tab to layout tab if the position of the tab is in model tab but if the tab is in the position in layout tab it does not need to move from layout tab to model tab. The tab have to stay in the layout position.

 

the programmings are posted are moving from model tab to layout tab and layout tab to model tab.

 

if u can it will be great

thanks of all programmer again

Posted
Thanks everyone for their nice programming skill.

But I like to want something different programming. I want to move the tab from Model tab to layout tab if the position of the tab is in model tab but if the tab is in the position in layout tab it does not need to move from layout tab to model tab. The tab have to stay in the layout position.

 

the programmings are posted are moving from model tab to layout tab and layout tab to model tab.

 

if u can it will be great

thanks of all programmer again

so just don't execute the command if in paper.

Posted
so just don't execute the command if in paper.

 

If you really want to be oblivious to what you are doing:

 

(defun c:tm ()
 (or (member (getvar "ctab") (layoutlist))
     (setvar "ctab" (car (layoutlist))))
 (princ))

Posted

Thanks Lee. It is a great helps for me

Posted

You could just have this of course:

 

(defun c:tm ()
 (setvar "tilemode" 0))

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