Jump to content

Tilemode switching


rjbrittain11

Recommended Posts

Standards when using the TM command is you have to put in a 1 or 0 depending on where you are. Is it possible to have a lisp that all you have to do is type TM and it automatically switches from where you are, whether it be paperspace or modelspace and switches you to the other without using the 1 or 0?

 

I am on a mac with AutoCAD 2015 if that helps anyone. I also don't know how to make lisp routines, only use them :D

 

I do remember one of my previous jobs we had a member of our team that was crazy good with AutoCAD programming. He had it set up this way on our PC's but that was in 2006-7 and i can't for the life of me remember what he did or how he did it.

Link to comment
Share on other sites

Here is your TM lisp have a look also at my GOTO lisp goto 0 goto 5 like jumping to pages.

(defun C:TMM ()
(if (= (getvar "tilemode") 1)
(setvar "tilemode" 0)
(setvar "tilemode" 1)
)
)

Edited by BIGAL
Link to comment
Share on other sites

You can toggle sysvars using something like this :

 

[b][color=BLACK]([/color][/b]defun c:tg [b][color=FUCHSIA]([/color][/b]/ v[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]initget 1 [color=#2f4f4f]"Blipmode Highlight splFrame Orthomode Tilemode Snapmode"[/color][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq v [b][color=NAVY]([/color][/b]getkword [color=#2f4f4f]"\nSYSVAR to Toggle - Blipmode/Highlight/splFrame/Orthomode/Tilemode/Snapmode:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setvar v [b][color=NAVY]([/color][/b]- 1 [b][color=MAROON]([/color][/b]getvar v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]princ v[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

 

I have a couple of combinations of acad and windows that the function keys are very quirky. So it's either ^b or a toggle for SNAPMODE to make sure it works 100% of the time.

 

You add any sysvar that honors values of 1 or 0 only.

 

-David

Link to comment
Share on other sites

Here is your TM lisp have a look also at my GOTO lisp goto 0 goto 5 like jumping to pages.

(defun C:TMM ()
(if (= (getvar "tilemode") 1)
(setvar "tilemode" 0)
(setvar "tilemode" 1)
)

 

sorry for the late reply. I copied this and it doesn't seem to work. Am i doing it right?

 

Steps:

1. Copied into a text file called TB.lsp

2. Put in my support folder under AutoCAD

3. Typed in APPLOAD

4. Loaded the lisp routine

5. typed TM in the command field

6. still getting the 0 or 1 option.

 

So it doesn't seem to have changed anything.

Link to comment
Share on other sites

You can toggle sysvars using something like this :

 

[b][color=BLACK]([/color][/b]defun c:tg [b][color=FUCHSIA]([/color][/b]/ v[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]initget 1 [color=#2f4f4f]"Blipmode Highlight splFrame Orthomode Tilemode Snapmode"[/color][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq v [b][color=NAVY]([/color][/b]getkword [color=#2f4f4f]"\nSYSVAR to Toggle - Blipmode/Highlight/splFrame/Orthomode/Tilemode/Snapmode:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setvar v [b][color=NAVY]([/color][/b]- 1 [b][color=MAROON]([/color][/b]getvar v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]princ v[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

 

I have a couple of combinations of acad and windows that the function keys are very quirky. So it's either ^b or a toggle for SNAPMODE to make sure it works 100% of the time.

 

You add any sysvar that honors values of 1 or 0 only.

 

-David

 

you have gone WAY over my head. Is this just another LISP routine that I load? Sorry for my basic n00b questions but im really new to LISP's

Link to comment
Share on other sites

sorry for the late reply. I copied this and it doesn't seem to work. Am i doing it right?

 

Steps:

1. Copied into a text file called TB.lsp

2. Put in my support folder under AutoCAD

3. Typed in APPLOAD

4. Loaded the lisp routine

5. typed TM in the command field

6. still getting the 0 or 1 option.

 

So it doesn't seem to have changed anything.

 

No, don't type TM. That is the normal Tilemode command. Type TMM to run the routine.

 

Also, I modified Bigal's code. It was missing a parentheses and throwing an error when loaded. Try this one:

(defun C:TMM ()

(if (= (getvar "tilemode") 1)

(setvar "tilemode" 0)

(setvar "tilemode" 1))

)

Link to comment
Share on other sites

No, don't type TM. That is the normal Tilemode command. Type TMM to run the routine.

 

Also, I modified Bigal's code. It was missing a parentheses and throwing an error when loaded. Try this one:

 

hmmmm.....

 

maybe i found my issue. Of course im using a mac with AutoCAD 2015...

 

I use command APPLOAD and i try to load TMM.lsp and it is saying its unable to load in the bottom of the dialog box once i highlight it as hit the Load button. Any reasons why?

 

I have copied the new code in. Sorry for the beginner questions is that is in fact the problem :D

Link to comment
Share on other sites

I have Zero experience with Autocad on Mac, so I don't know why the lisp routine won't load. It loads and runs fine on my PC.

 

You copied all of the code that I posted previously, including the last parenthesis at the very bottom, pasted into Notepad and saved as TMM.lsp, correct?

 

Are you able to load and run other lisp routines?

Link to comment
Share on other sites

You may need to make it a trusted lisp this was bought in about 2014 you can turn it off so it does not check. Maybe this.

 

https://forums.autodesk.com/t5/autocad-for-mac-general/trusted-location-for-custom-lisp-file-acad-mac/td-p/4550515

 

ok so i followed the TRUSTEDPATCH command and it seemed to have worked. Really strange that you still have to do that after you put the file location in the Support Paths. But I seem to have gotten it to work.

 

Thanks all!

Link to comment
Share on other sites

alright next question. I have added an acaddoc.lsp to this folder that i have added to the trusted list. How do i get this to load all my LISP routines automatically when I open AutoCAD? My understanding is that AutoCAD looks for the acaddoc.lsp file and loads whats in it. I have added my code below to what is in this file. Maybe its not coded right? This could be very likely the problem! HAHA

 

(load “arcarrow”)

(load “burst”)

(load “flexspline”)

(load “paste_as_block”)

(load “tmm”)

(load “txt2txt_mod1”)

(load “xclipm”)

(load “tb”)

Link to comment
Share on other sites

I have added an acaddoc.lsp to this folder that i have added to the trusted list. How do i get this to load all my LISP routines automatically when I open AutoCAD?

 

You have to tell Autocad where the routines are located.

 

Example:

 

(load "C:/Program Files/Lisp/arcarrow.lsp")

(load "C:/Program Files/Lisp/burst.lsp")

(load "C:/Program Files/Lisp/flexspline.lsp")

etc. . . .

Link to comment
Share on other sites

You have to tell Autocad where the routines are located.

 

Example:

 

(load "C:/Program Files/Lisp/arcarrow.lsp")

(load "C:/Program Files/Lisp/burst.lsp")

(load "C:/Program Files/Lisp/flexspline.lsp")

etc. . . .

 

awww i will try that.

Link to comment
Share on other sites

ok below is my code and still a no go on the acaddoc.lsp auto loading at start up.

 

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/arcarrow.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/burst.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/flexspline.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/paste_as_block.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/tmm.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/txt2txt_mod1.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/xclipm.lsp”)

(load “/users/robertbrittain/library/application support/autodesk/roaming/autocad 2015/r20.0/enu/support/tb.lsp”)

Link to comment
Share on other sites

Again I have to plead ignorance. Is that how the Mac file paths look? There is no C:/?

 

ya there is no "C:/"

 

this is how it looks in the information on the file:

 

/Users/robertbrittain/Library/Application Support/Autodesk/roaming/AutoCAD 2015/R20.0/enu/Support

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