Jump to content

Search the Community

Showing results for tags 'cmdactive'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. Hi, I was hoping to LOAD a lsp file then call it via (c:runthislispfile) inside another routine to combine them in one. Problem is, they prompt for a selection, so I thought this would work: (command "_P") (while (eq 1 (logand 1 (getvar 'CMDACTIVE))) (command "")) Is this possible? I'm pretty sure it is with the cmdactive trick. See code below and comments where the problem lies: (defun c:---BB (/) (progn (LOAD "3dwannab_ByBlock_Change_Entities") (C:BB))) ; Change all selected entities to ByBlock and layer 0 & more. (defun c:BB ( / ss_1 ) (setq *error* SS:error) (SS:startundo) (setq cmde (getvar "cmdecho")) (setq os (getvar "osmode")) (setq orthom (getvar "orthomode")) (setvar 'cmdecho 0) (setvar 'osmode 83) (setvar 'orthomode 1) (progn (setq ss_1 (last (ssgetfirst))) (if (not ss_1) (setq ss_1 (ssget '((0 . "~HATCH")))) ) (if ss_1 (progn (command "._chprop" "_non" ss_1 "" "_LA" "0" "") (command "._chprop" "_non" ss_1 "" "_LT" "BYBLOCK" "") (command "._chprop" "_non" ss_1 "" "_LTS" "1" "") (command "._chprop" "_non" ss_1 "" "_LW" "BYBLOCK" "") (command "._chprop" "_non" ss_1 "" "_TR" "BYBLOCK" "") (command "._chprop" "_non" ss_1 "" "_C" "BYBLOCK" "") ;; How do I run the command for this lisp then select previous and run it automatically. ;; Below doesn't work. ;; This routine is for rounding off entities to the nearest 0.5mm. (prompt "\nRUN the F5 command also to round off to 0.5mm ?\n") (load "FX_Round_Numbers_0Point5") (progn (c:F5) (command "_P") (while (eq 1 (logand 1 (getvar 'CMDACTIVE))) (command "")) ) ;; How do I run the command for this lisp then select previous and run it automatically. ;; Below doesn't work. ;; This is the PSIMPLE command to fix polylines. Again it prompts for a selection here. (prompt "\nRUN the PSIMPLE command also ?\n") (load "PSimple") (progn (c:PSIMPLEV) (command "_P") (while (eq 1 (logand 1 (getvar 'CMDACTIVE))) (command "")) ) (setq ss_1 nil) ) (princ "\nUser Cancelled Command\n") ) ) (*error* nil) (princ) ) (defun SS:error (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (setvar 'cmdecho cmde) (setvar 'osmode os) (setvar 'orthomode orthom) ) (defun SS:startundo () (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) ) (vl-load-com) (princ (strcat "\n3dwannab_ByBlock_Change_Entities.lsp Loaded\n" "\nInvoke by typing 'BB'\n" ) ) (princ) ;;----------------------------------------------------------------------;; ;; End of File ;; ;;----------------------------------------------------------------------;;
×
×
  • Create New...