1 / 47

Hands-On Customizing in AutoCAD

Hands-On Customizing in AutoCAD. Dan Abbott. Professor, Southern Maine Community College. John Jordan Volker Cocco. Lab Assistants. Agenda. External Commands and Aliases Tool Palettes – all releases Linetypes – all releases Tool Bars – CUI Tool Buttons – CUI Dashboard -- 2008

aggie
Download Presentation

Hands-On Customizing in AutoCAD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hands-On Customizing in AutoCAD Dan Abbott Professor, Southern Maine Community College

  2. John Jordan Volker Cocco Lab Assistants

  3. Agenda External Commands and Aliases Tool Palettes – all releases Linetypes – all releases Tool Bars – CUI Tool Buttons – CUI Dashboard -- 2008 Menu customizing – CUI Scripts – all releases Intro to AutoLISP – all releases Demo Automating Drawing Update

  4. Add A New User To Computer Control Panel User Accounts Create A New Account Any Name is Fine Make It Administrative Log Off Switch Users Start AutoCAD Before You Start Customizing

  5. Autodesk University 2005 Anti-frustration Team: John Jordan Volker Cocco Just Raise Your Hand and They Will Come Schedule 9:30-10:00 – break for questions/water/relief AutoLISP after break Workshop Structure

  6. Autodesk University 2005 Change Default Path Using OPTIONS Default path is C:\documents and settings\%username%\Local Settings\Application Data\Autodesk\AutoCAD 2006\R16.1\enu\template Consider placing files in a common network folder. Any drawing can become a template Make changes, and save with a .dwt extension Template Files – path

  7. Autodesk University 2005 Template Files – OPTIONS

  8. Autodesk University 2005 Layers with appropriate linetypes assigned Dimension styles with child variations Appropriate text styles with a height of zero Table Styles Mleader Style General block definitions, including title blocks Standard layouts for specific plotters and sheet sizes Variables that are saved in the drawing UCSICON; PLINEGEN; MIRRTEXT; LTSCALE; CELTSCALE; PSLTSCALE; MEASUREMENT; DIMASSOC; PSVPSCALE Template Files -- What to include

  9. ACAD.pgp • Path is long: • C:\ Documents and Settings… • And includes a hidden folder Easy way to open a file in the search path: (Startapp "Notepad" (Findfile "Acad.Pgp")) Autodesk University 2005

  10. Autodesk University 2005 WORD, start winword,1,, CALC, start calc,1,, PGP, start notepad C:\CP21-1L\acad.pgp AU, start iexplore www.autodesk.com/au,1,, WORK, explorer C:\Custom,1,, External Command Samples

  11. Autodesk University 2005 RI, *REINIT CY, *CYLINDER DRG, *DIMREGEN ALIASEDIT Express Tool Command Alias Samples

  12. Autodesk University 2005 Tools By Example: drag and drop nearly any object mleader, dimension, block, hatch, gradient fill, raster image, xref, or any geometric object Commands: drag and drop from customize window Groups of Blocks: Use Design Center, right-click Groups of Hatch Patterns: Use Design Center Tool Palettes

  13. Autodesk University 2005 Tool Palettes – Tool Properties • Create a New Tool Palette • Create a MultiLeader Style [MLS] • Create a MultiLeader [MLD] • Drag Onto A tool Pallette • Modify Properites

  14. Autodesk University 2005 Tool Palettes – Design Center

  15. Autodesk University 2005 Enterprise CUI file -- custom company standards Partial CUI files -- third party menus or custom menus Main CUI file (ACAD.cui) – your personal preferences We’ll be modifying only the ACAD.cui file today CUI File Organizing

  16. Autodesk University 2005 CUI command Right-click on Toolbars Select "New" Name your Toolbar Display at bottom Toolbars

  17. Autodesk University 2005 Change to the "Commands" list window Pick a category Drag and drop any of the commands or control windows to your toolbar Toolbars

  18. Autodesk University 2005 Toolbar Example

  19. Autodesk University 2005 Types of Content – Control Windows

  20. Autodesk University 2005 Select the "New" button in Command List pane Define the new command in the Properties pane Change the name, description and macro Tool buttons – new command

  21. Autodesk University 2005 ^C^C^C-style;romans;romans;0;1;0;;;;dtext;\0.125;0; ^C cancel – same as pressing ESC key -style command line version of STYLE command ; represents an ENTER. ;;;; = 4 ENTERs \ causes the macro to pause once for input Tool button macro example

  22. Add New Tool Button to Toolbar • Highlight New Command • Drag and Drop onto toolbar Autodesk University 2005

  23. Add Icon to Tool Button • Select Button Image • Select Edit Button • Edit or Clear Image • Save With Name • Select Last Button Autodesk University 2005

  24. Dashboard • Select “Dashboard Panels” • Add New Panel Autodesk University 2005

  25. Dashboard • Select “Dashboard Panels” • Add New Panel Autodesk University 2005

  26. Organize Dashboard • WorkSpaces • Add Panels for a Workspace • Change Order of Panels • Create Workspaces • Modify Other Aspects Autodesk University 2005

  27. Autodesk University 2005 Osnap Cursor Menu Shift + Right-Click Contains OSNAPS Drag and Drop Reorganize Add from Command List Delete Right-Click on Command Short Cut Menus – Osnap

  28. Autodesk University 2005 Pull Down

  29. Autodesk University 2005 Redefine Function Keys: F1 ^C^C(sssetfirst nil) F12 'cal;(nea + nea)/2; Quick Keys

  30. Autodesk University 2005 Grips Menu • Create a new rotate/copy/base command: • Rotate;Copy;Base; • Drag and drop it onto your Grips Cursor Menu

  31. Autodesk University 2005 Create Additional Text-Based Linetypes Open ACAD.lin or ACADISO.lin – (startapp "notepad" (findfile "acad.lin")) Copy an existing linetype, like HW or GAS Change Properties and Edit Text Save File and Load your new linetype Linetypes: ACAD/ACADISO.lin

  32. Autodesk University 2005 Linetypes: ACAD/ACADISO.lin Copy This: *HOT_WATER_SUPPLY,Hot water supply ---- HW ---- HW A,.5,-.2,["HW",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2 Change to This: *COLD_WATER_SUPPLY,Cold water supply ---- CW ---- CW A,.5,-.2,["CW",ROMANS,S=.1,R=30,X=-0.1,Y=-.07],-.2 A, = Alignment Code .5 = line segment length -.2 = size of gap "CW" = text "Romans" = style name S = txt height R = Rotation Angle (degrees) X & Y = Offset From Gap Center

  33. Autodesk University 2005 Use the MKSHAPE and MKLTYPE expresstools For text Draw a repeatable pattern for linetype Execute the MKLTYPE command For shapes Draw a vector-based shape Execute the MKSHAPE command Load the new shape into the drawing Execute the MKLTYPE command Linetypes: Express Tools

  34. Autodesk University 2005 You May NOT Want to Use Shape Files Shape Files Must Accompany Drawings Alternative Is to Use Blocks and MEASURE Layout a Spline Fit PLINE Linetypes: Express Tools

  35. Autodesk University 2005 We will start with Scripts and AutoLISP after Break BREAK – 30 mlnutes

  36. Autodesk University 2005 ASCII Text File Extension Must Be .SCR (same as Windows screen savers, by the way) Whatever You Would Type at Command Prompt Space or New Line = ENTER SCRIPT Command File Dialog Box Opens Find .SCR file Select A Script File SCRIPTS

  37. Autodesk University 2005 STYLE romans romans 0 1 0 N N N LAYER N Lay1,Lay2,Lay3 C 1 Lay1 C 2 Lay2 C 3 Lay3 OSMODE 4135 Startup Switch /b Desktop Shortcut Icon "C:\program files\AutoCAD 2006\acad.exe” /b setup.scr Batch Files SCRIPTS – Sample

  38. Autodesk University 2005 Type VLISP at command line to start program. Save as: "C:\custom\ACADDOC.lsp" Add this to top (with your own data) AutoLISP Create and save file

  39. Autodesk University 2005 (defun c:ZX( ) (command"ZOOM" "E" "ZOOM" ".90x") ) Creates New AutoCAD Command named "ZX" Zooms to Extents of Drawing Reduces Screen Image to 90% Steal this code and write some more: ZA, ZP, etc. AutoLISP EX. 1 – New Command

  40. Autodesk University 2005 (defun c:c( ) (command"circle" pause "d") ) Takes precedent over the alias "C" Gets Center Point and From Operator Draws Circle With Diameter, NOT Radius AutoLISP EX. 2 -- Mod Command

  41. Autodesk University 2005 Transparent Conversions (defun i (i) (* i 25.4) ) (defun m (m) (/ m 25.4) ) AutoLISP EX. 3 – New Lisp Functions

  42. Autodesk University 2005 Doing Calculations and Presenting Results (defun c:i2m (/ st1 st2 ) (setq in (getdist"\nGive value in inches: ")) (setq mm (* in 25.4)) (setq st1 (rtos in 2 3)) (setq st2 (rtos mm 2 2)) (alert(strcat"Value of " st1 " inches is " st2 " mm")) ) Rewrite this later as m2i so you can go the other way. AutoLISP EX. 4 – variables

  43. Autodesk University 2005 Change objects to a named layer (defun C:CL(/ ss1 layname) (setq ss1 (ssget)) (setq layname (getstring"\nDestination layer:")) (command"LAYER" "N" layname "" "CHPROP" ss1 "" "LA" layname"") ) AutoLISP EX. 5 – GET functions

  44. Autodesk University 2005 (defun c:number (/ st1 st2 point num) (setq num (getint"\nFirst number in sequence <1>:")) (if(= num nil) (setq num 1) ) (setq point (getpoint"\nInsertion point:")) (while point (setq st1 (itoa num)) (setq st2 (strcat"#" st1)) (command"TEXT" point "0.12""0" st2) (setq point (getpoint"Select insertion point:")) (setq num (+ num 1)) ) ) AutoLISP EX. 6 –counter

  45. Autodesk University 2005 Ten Basic Rules for Lisp Programming 1. ASCII (DOS) text files. VLISP is the editor of choice.   2. BALANCE. Open and closed quotes and parentheses 3. DEFUN C:. Function as a new AutoCAD 4. ENTER and CANCEL. “” = ENTER; (command) = ESC 5. BACKSLASH. Separate folders with \\ or / AutoLISP – 10 Basic Rules

  46. Autodesk University 2005 Ten Basic Rules for Lisp Programming 6. VARIABLES. Add them AFTER trouble-shooting (/ p1) 7. NEWLINE. Use \n (lower case) for new line alert 8. ANNOTATE. Use semi-colons (;) for comments 9. STRUCTURE. Get info from user or drawing first 10. PERSIST. Don't get discouraged and have fun! AutoLISP – 10 Basic Rules

  47. Dan Abbott – Southern Maine Community College dan@DanAbbott.com 207 741-5564 Hands On Customizing

More Related