wakibd Posted May 6, 2009 Share Posted May 6, 2009 IS THERE ANY COMMAND TO SWITCH MODEL TAB TO LAYOUT TAB. I USED .BUT IT DOES NOT WORK. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted May 6, 2009 Share Posted May 6, 2009 (defun c:tm (/) (setvar 'tilemode (if (zerop (getvar 'tilemode)) 1 0 ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
wakibd Posted May 8, 2009 Author Share Posted May 8, 2009 Thanks for your lisp program. But when i am using it gives the following error ; error: AutoCAD variable setting rejected: TILEMODE nil Command: Quote Link to comment Share on other sites More sharing options...
ronjonp Posted May 8, 2009 Share Posted May 8, 2009 Strange...what version of cad are you using? Quote Link to comment Share on other sites More sharing options...
CarlB Posted May 8, 2009 Share Posted May 8, 2009 It should have worked, did you copy & paste the code? here's a slightly differnet version: (defun c:tm (/) (setvar 'tilemode (- 1 (getvar 'tilemode)) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted May 8, 2009 Share Posted May 8, 2009 This's a new one 'tilemode It was always "tilemode" Did it change? -David Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 I thought they were two of the same? 'tilemode and "tilemode" Quote Link to comment Share on other sites More sharing options...
ronjonp Posted May 8, 2009 Share Posted May 8, 2009 Here is my favorite version (I believe Se7en is the original author) (defun c:tm (/) (setvar 'tilemode (boole 6 1 (getvar 'tilemode))) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 ^^ pretty neat Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 8, 2009 Share Posted May 8, 2009 much less elegant, but since many options are being offered, i thought i'd throw another option in the mix: (defun c:TM (/) (if (eq (getvar 'tilemode) 1) (setvar 'tilemode 0) (setvar 'tilemode 1) ) (princ) ) se7en's is by far the most impressive. they all do the same thing. 6 in one, half a dozen in the other. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 While we're all at it... (defun c:tm () (or (and (zerop (getvar 'tilemode)) (setvar 'tilemode 1)) (setvar 'tilemode 0)) (princ)) Quote Link to comment Share on other sites More sharing options...
ronjonp Posted May 8, 2009 Share Posted May 8, 2009 And to further complicate things:D: (defun c:tm (/ 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) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 Not sure if COND has been used yet... (defun c:tm () (cond ((zerop (getvar 'tilemode)) (setvar 'tilemode 1)) (T (setvar 'tilemode 0))) (princ)) Quote Link to comment Share on other sites More sharing options...
Freerefill Posted May 8, 2009 Share Posted May 8, 2009 A "CTAB" is fine too.. (defun c:tm( / ) (if (member (getvar "ctab") (layoutlist)) (setvar "ctab" "Model") (setvar "ctab" (nth 0 (layoutlist))) ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 8, 2009 Share Posted May 8, 2009 And to further complicate things:D: (defun c:tm (/ 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) ) showoff Quote Link to comment Share on other sites More sharing options...
Commandobill Posted May 8, 2009 Share Posted May 8, 2009 Fine i made one... (defun c:tmz( / ) (if (member (getvar "ctab") (layoutlist)) (setvar "ctab" "Model") (command "layout" "set" (nth 0 (layoutlist))) ) ) Quote Link to comment Share on other sites More sharing options...
wizman Posted May 8, 2009 Share Posted May 8, 2009 here's another one....'-): (defun c:tm (/) (setvar 'tilemode (nth (getvar 'tilemode) '(1 0))) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 here's another one....'-): (defun c:tm (/) (setvar 'tilemode (nth (getvar 'tilemode) '(1 0))) (princ) ) Ingenius - hadn't thought of that one Quote Link to comment Share on other sites More sharing options...
Commandobill Posted May 8, 2009 Share Posted May 8, 2009 lol it's not pretty but i threw it together (defun c:tmz ( / 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) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 8, 2009 Share Posted May 8, 2009 Couldn resist: [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:tm [b][color=RED]([/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=DARKRED]'[/color][/b]TILEMODE [b][color=RED]([/color][/b][b][color=BLUE]rem[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] [b][color=#009900]1[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]getvar[/color][/b] [b][color=DARKRED]'[/color][/b]TILEMODE[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]rem[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-string->list[/color][/b] [b][color=#ff00ff]"TILEMODE"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=#009900]86[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.