Jump to content

Macro, Script or Lisp?


Recommended Posts

What would be the best way to have the following occur automatically when you open a drawing?

Grid on, set to .125

Snap on, set to .0625

Ortho and Osnap off

 

I'm familiar with "old fashioned" line by line scripts, but that's about it........sad I know.

Link to comment
Share on other sites

One could ask why aren't these set as a part of your template?

Would you ever be toggling all these on/off enmasse during a drawing session?

Link to comment
Share on other sites

One could ask why aren't these set as a part of your template?

Would you ever be toggling all these on/off enmasse during a drawing session?

 

Actually Remark, these are the "personal" working preferences of my supervisor and I'm trying to eliminate some of the stress in her life. It drives her crazy when she works behind someone who uses other preferences.

Link to comment
Share on other sites

You could set that up in the ACADDOC.LSP

 

Search around on CADTutor for tips on modifying the ACADDOC.LSP and creating custom macro for a button.

Link to comment
Share on other sites

Thanks for the input. I searched the net a bit yesterday and I think modifying the acaddoc.lsp is probably the way to go. I could write a script for her to run across the project before she started working on the drawings, but she would prefer not to have to do anything other than open the drawing.

Link to comment
Share on other sites

Thanks for the input. I searched the net a bit yesterday and I think modifying the acaddoc.lsp is probably the way to go. I could write a script for her to run across the project before she started working on the drawings, but she would prefer not to have to do anything other than open the drawing.

 

There are plenty of examples on CADTutor for modifying the ACADDOC.LSP, just remember to save your original with another name, I usually go with acaddocoriginal.lsp.

Link to comment
Share on other sites

One could do things a lot simpler, but this is what I run at startup...

 

(defun AlanIfCheck (/)
 (if (eq (strcase (getvar "loginname")) "ATHOMPSON")
   (progn
     (foreach var
              '(("fullplotpath" 0)
                ("dtexted" 0)
                ("inputhistorymode" 0)
                ("vtenable" 0)
                ("insunits" 0)
                ("osnaphatch" 0)
                ("traynotify" 0)
                ("mtextfixed" 0)
                ("cursorsize" 100)
                ("cecolor" "bylayer")
                ("celtscale" 1)
                ("celtype" "bylayer")
                ("gripsize" 6)
                ("pickbox" 5)
                ("aperture" 20)
                ("peditaccept" 1)
                ("BLIPMODE" 0)
                ("CMDECHO" 0)
                ("FILEDIA" 1)
                ("MIRRTEXT" 0)
                ("PLINEGEN" 1)
                ("UCSICON" 1)
                ("mtextfixed" 0)
                ("mtexted" "internal")
                ("mtjigstring" "ajt :-)")
                ("attreq" 1)
                ("dynmode" -2)
                ("lockui" 3)
                ("shortcutmenu" 18)
                ("osnapz" 1)
                ("xreftype" 1)
                ("layernotify" 4)
                ;; ("savetime" 15)
                ("selectionarea" 0)
                ("autosnap" 63) ; 55)
                ("snapmode" 0)
                ("gridmode" 0)
                ("expert" 0)
                ("dimassoc" 2)
                ("edgemode" 1)
                ("SELECTIONANNODISPLAY" 0)
                ("MTEXTTOOLBAR" 1)
                ("modemacro"
                 "$(getvar,clayer)  ($(edtime, $(getvar,date),H:MMam/pm) - $(edtime,$(getvar,date),M.DD.YY))  Textsize: $(getvar,textsize) $(if, $(!=, $(getvar,viewtwist), 0), Viewtwist: $(angtos, $(getvar,viewtwist) [, 0, 2]) , ) AnnoScale: $(getvar,cannoscale)  Dimscale: $(getvar,dimscale) $(if, $(!=, $(getvar,filletrad), 0), FilletRad: $(getvar,filletrad), ) $(if, $(=, $(getvar,worlducs), 1),*WCS* ,*NON-WCS*) "
                )
               )
       (vl-catch-all-apply (function setvar) var)
     )
     (command "_.wipeout" "_f" "_off")
     (command "_.sheetsethide")

     (princ (strcat "\nHey " (getvar "loginname") " you are all setup!"))
   )
   (alert "Who the hell are you?")
 )
 (princ)
)

Link to comment
Share on other sites

:lol::lol::lol::lol::lol::lol::lol::lol:

I'm a not lisp guru, but even I've read enough to know what

 

(alert "Who the hell are you?")

does.

 

You just made my day.

Link to comment
Share on other sites

Who are you, who, who, who, who.

 

Now that the song is stuck in my head I'll just have to load up my Who - Live at Leeds CD and blast away!

Link to comment
Share on other sites

:lol::lol::lol::lol::lol::lol::lol::lol:

I'm a not lisp guru, but even I've read enough to know what

 

 

does.

 

You just made my day.

:lol: I like to have fun with my code.

 

Who are you, who, who, who, who.

 

Now that the song is stuck in my head I'll just have to load up my Who - Live at Leeds CD and blast away!

Me too!
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...