save reactor

Discussion in 'AutoCAD' started by Randal Morrison, Sep 16, 2003.

  1. I have a save drawing reactor that worked fine untill i added:
    (command "-layer" "ps" "solid" "*" "")
    is there are reason that i cant use "command" and if so is there another way
    to do this?



    Thanks alot for your help
    below is my entire code:


    (vl-load-com) ;load activeX fcns

    (setq MyReactor1 ;name of fcn
    (vlr-dwg-reactor ;type of reactor
    nil
    '(:)vlr-SaveComplete . DoThisAfterSave) ;on save complete reactor
    )
    )
    )

    (defun DoThisafterSave (Caller CmdSet) ;after save is finished do this
    (setq dname (menucmd "M=($(getvar, dwgname))"));get filename
    (if (= (wcmatch dname "*-week??-??-??.dwg*") nil);does file name match
    this criteria
    (progn
    (vlr-beep-reaction)
    (alert "Your file name does NOT match the class standard of:\n
    lastname-week##-##-##.dwg \nYou will have to resave the file with the
    correct naming syntax \nPlease see your TA if you have questions");if not
    set this alert
    (command "-layer" "ps" "solid" "*" "")
    )
    )
    (princ)
    )
     
    Randal Morrison, Sep 16, 2003
    #1
  2. Randal Morrison

    John Uhden Guest

    You have to use VisualLip/ActiveX in reactor callbacks...
    (vlax-for Layer Layers ...) where Layers would be the document's layer
    collection object.
     
    John Uhden, Sep 16, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.