Jump to content

Search the Community

Showing results for tags 'command reactor'.

  • 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. So I want to be able to set things inside functions when the command is called up in the command line. I tried using a command reactor. It works fine when it is outside of the function that I wanted for it to be activated but when I put it inside the function, it doesnt seem to be getting the values of the variables before the command is called up. so I have a simple function used for texting. (defun c:trec() (reactoron) (command "rectang") ) This is not the actual function I want to use in autocad but using this as my test. So this is my reactor which lives in reactoron. (defun reactoron() (vl-load-com) (vlr-command-reactor nil '((:vlr-commandWillStart . startCommand))) (vlr-command-reactor nil '((:vlr-commandEnded . endCommand))) (vlr-command-reactor nil '((:vlr-commandCancelled . cancelCommand))) (defun startCommand (calling-reactor startcommandInfo / thecommandstart) (setq OldLayer (getvar "CLAYER")) (setq thecommandstart (nth 0 startcommandInfo)) (cond ((= thecommandstart "TREC") (setvar "CLAYER" "4")) ) (princ) ) (defun endCommand (calling-reactor endcommandInfo / thecommandend) (setq thecommandend (nth 0 endcommandInfo)) (cond ((= thecommandend "TREC") (setvar "CLAYER" OldLayer)) ) (vlr-remove-all) (princ) ) (defun cancelCommand (calling-reactor cancelcommandInfo / thecommandcancel) (setq thecommandcancel (nth 0 cancelcommandInfo)) (cond ((= thecommandcancel "TREC") (setvar "CLAYER" OldLayer)) ) (vlr-remove-all) (princ) ) ) I should thank afralisp for the code sample which this code here is based from. So someone help me find a way to be able to activate this command reactor inside my function TREC?
×
×
  • Create New...