• Skip to main content
  • Skip to primary sidebar
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

Sample Macros for AutoCAD

August 1, 2000 Leave a Comment

Save/Restore OSMODE from a file

1> Save the OSMODE system variable to a file. (could be used for other system variables):

^C^C^P(progn(setq OSFILENAME (open "u:/acad2000/SavedOSnap.txt" "w"))
(write-line (itoa (getvar "osmode")) OSFILENAME)
(close OSFILENAME)

2> Extract the OSMODE system variable from a saved file.

^C^C^P(progn(setq reados (open "u:/acad2000/SavedOSnap.txt" "r"))
(setvar "osmode" (atoi (read-line reados)))(close reados))

Change layer color, by clicking on it

^C^C^P(setq currentlayer(getvar "clayer"))
;LAYISO;;-LAYER;C;;^CRS;
(setvar "clayer" currentlayer)

Load Menu from File

^C^C^P(command "menuunload" "Menu Group Name" "_.menuload" "Menu File Name.mnu")

Filed Under: AutoCAD Tutorials

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to our Youtube Channel

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (24)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (28)
  • AutoCAD Tutorials (42)
  • AutoLISP Routines (145)
  • AutoLISP Tutorials (15)
  • CAD Standards (6)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (65)
  • Electrical Drafting (2)
  • General IT reference (10)
  • Geometry (15)
  • GIS (2)
  • Office Life Hacks (1)
  • PT (1)
  • Revit Tutorials (53)
  • Steel Detailing (12)
  • Structural Drafting (23)
  • Technical Dictionary (45)
  • Useful Website Links (19)

Provided for free with no warranty ยท Log in