HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

CAD shortcut commands

2008-02-26View Original

Thread Content

;;========================================Custom function library;;======Get the AutoCAD object first (setq * acad * (vlax-get-acad-object)) ;;====== Then get the current document (setq * doc * (vlax-get-property * acad * 'ActiveDocument)) ;;===== Then send a command to the current document, and the command parameter is a string. ;;====== The format of the command is the same as the manual input command, note that a space is used to indicate confirmation. ;;====== If there is no space at the end, the command will be written to the command line but not executed immediately. ;;For example (defun c:B () (vla-sendcommand * doc * "BLOCK ")) Where "B" is a customized shortcut command and "BLOCK " is a system command. ;;======================================== Shortcut command list;;======Single key(defun c:A () (command "ARC")) ;Arc(defun c:B () (vla-sendcommand * doc * "BLOCK ")) ;Block definition (defun c:C () (command "CIRCLE")) ; Circle (defun c:D () (vla-sendcommand * doc * "DIMSTYLE ")) ; Dimension style (defun c:E () (command "ERASE")) ; Delete (defun c:F () (COMMAND "FILLET")) ; Fillet (defun c:R () (COMMAND "REGEN")) ; Regenerate model (defun c:S () (COMMAND "STRETCH")) ; Stretch (defun c:T () (COMMAND "_.TRIM" "")) ;Cut (automatically cut the nearest part) (defun c:V () (COMMAND "MOVE")) ;Move (defun c:W () (vla-sendcommand * doc * "WBLOCK ")) ; write block (defun c: * doc * "INSERT ")) ;Insert (defun c:XX () (COMMAND "OPTIONS")) ;Options (defun c:GS () (COMMAND "MATCHPROP")) ;Format brush (defun c:BZ () (COMMAND "DSETTINGS")) ;Object capture (defun c:AD () (COMMAND "APPLOAD")) ;Load application (defun c:SC () (COMMAND "SCALE")) ;Zoom in, zoom out (defun c:ST () (vla-sendcommand * doc * "STYLE ")) ; Text style (defun c:RE () (COMMAND "RECTANG")) ; Rectangle (defun c:RT () (COMMAND "ROTATE")) ; Rotation (defun c:DV () (COMMAND "DIVIDE")) ; Divide (defun c:FD () (COMMAND "FIND")) ; Find (defun c:BB () (vla-sendcommand * doc * "BHATCH ")) ;Pattern fill(defun c:BR () (COMMAND "BREAK")) ;Break(defun c:EX () (COMMAND "_.EXTEND" "")) ;Extend (automatically extend to the nearest intersection) (defun c:VE () (COMMAND "MOVE")) ;Move (defun c:ED () (COMMAND "PEDIT")) ;Multiple line segment, single line conversion (defun c:DB () (COMMAND "POLYGON")) ;Polygon (defun c:EE () (vla-sendcommand * doc * "LINETYPE ")) ; Line type manager (defun c:AE () (vla-sendcommand * doc * "LAYER ")) ; Layer manager (defun c:DT () (COMMAND "DIST")) ; Query distance (defun c:DE () (COMMAND "DIMLINEAR")) ; Line label (defun c:DR () (COMMAND "DIMRADIUS")) ; Radius label (defun c:DD () (COMMAND "DIMDIAMETER")) ; Diameter label (defun c:DA () (COMMAND "DIMANGULAR")) ;Download the fan mark and save it as * .LSP file, start CAD, APPLOAD and that’s it!

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.