macros anyone ?

I'm using the command rotate 180 on entities ALOT, is there a method, perhpas, where I can make this specific command ultra-fast to excecute ?

Comments

  • Hm, I don't know about "ultra fast", but this macro saves you from having to type the rotation angle. Of course you still have to select the entities and pick a rotation point.

    ^c^c_select;\_rotate;p;;\180;

  • Unable to recognize command "^c^c_select;\_rotate;p;;\180;". Please try again.
    and after it works, how do I avtivate it ? (thanks btw! :)  )

  • The macro in post #2 is a macro for a toolbar or menu. You can activate such a macro by clicking the appropriate toolbar or menu item or by using a keyboard shortcut. Check out the Customize command in the Bricscad Help for more information.

    However, if you just want to set up an alias, you could put this simple lisp in the Command field of the Add Alias dialog box (added advantage of this lisp: also works with a pre-selection):

    (command "_.rotate" (ssget) "" pause "180")(princ)

  • sweet

  • For some reason I can't get my toolbar button scripts to run (I'm in the middle of translating them from AutoCAD to Brics)  Here's the one of been using - it's very much like your example above but is a scale metric function:

    ^C^CSELECT;\SCALE;PREVIOUS;;\.039370079;

    I also tried the one above, just as it's typed:

    ^c^c_select;\_rotate;p;;\180;

    Neither work for me, any idea why?  I'ts so simple, was hoping not to create a lisp routine for it

  • For some reason I can't get my toolbar button scripts to run (I'm in the middle of translating them from AutoCAD to Brics)  Here's the one of been using - it's very much like your example above but is a scale metric function:

    ^C^CSELECT;\SCALE;PREVIOUS;;\.039370079;

    I also tried the one above, just as it's typed:

    ^c^c_select;\_rotate;p;;\180;

    Neither work for me, any idea why?  I'ts so simple, was hoping not to create a lisp routine for it

  • I use a lisp routine to make a pre-selected set rotate 90 degrees around its centroid, so I don't have to pick the fulcrum point. And it leaves the stuff still selected, so I can keep hitting the space bar to get 180 or 270 (or just to make it spin around, which is fun).

     

    ;;; ---Rot90 rotates a selection set 90° about its centroid---
    ;;; -------------------------------------------------------------------------
    ;;; the bounding-box processing came from Jason Rhymes
    ;;; GetBoundingBox method returns opp. corner points of a box that encloses the specified object
    ;;; ActiveX signature: object.GetBoundingBox MinPoint, MaxPoint
    ;;; Visual Lisp (vla) function syntax: (vla-method object arg1 arg2 ...)
    ;;; -------------------------------------------------------------------------
    (defun c:Rot90 (/ AcDoc SelSet AcSS Ent1 ListX1 ListY1
    ListX2 ListY2 Xmin Xmax Ymin Ymax
    Point1 Point2 Point3 Point4 Ctr ep1 ep2 Dx Dy )

    (setq AcDoc (vla-get-activedocument (vlax-get-acad-object)))
    (setq SelSet (ssget))
    (setq AcSS (vla-get-activeselectionset AcDoc))

    (vlax-for Ent1 AcSS (vla-GetBoundingBox Ent1 'p1 'p2)
    (setq ListX1 (cons (car (vlax-safearray->list p1)) ListX1))
    (setq ListY1 (cons (cadr (vlax-safearray->list p1)) ListY1))
    (setq ListX2 (cons (car (vlax-safearray->list p2)) ListX2))
    (setq ListY2 (cons (cadr (vlax-safearray->list p2)) ListY2))
    )
    (setq Xmin (apply 'min ListX1))
    (setq Ymin (apply 'min ListY1))
    (setq Xmax (apply 'max ListX2))
    (setq Ymax (apply 'max ListY2))

    (setq Point1 (list Xmin Ymin 0.0))
    (setq Point2 (list Xmax Ymax 0.0))
    (setq Point3 (list (car Point2) (cadr Point1) 0.0))
    (setq Point4 (list (car Point1) (cadr Point2) 0.0))

    (setq Ctr (polar Point1 (angle Point1 Point2) (/ (distance Point1 Point2) 2)))

    (command "ROTATE" "p" "" Ctr "90") (sssetfirst nil (ssget "P"))
    ) ;;; -------------------------------------------------------------------------

     

     

  • @ Bill Tybring:
    Your macro:
    ^C^CSELECT;\SCALE;PREVIOUS;;\.039370079;
    works just fine (tested with BC 10.4.8).

  • Thanks for the info Roy, I'm on Brics 10.3.16, perhaps that is the difference.  I will DL the latest.

    Funny tho, it just seems to get all confused with the prompts, however, the code: ^c^c(command "_.scale" (ssget) "" pause ".039370079")(princ) works perfectly every time as long as I have "texteval" turned on.

  • Dear Bill,
    as it seems, TEXTEVAL is probably respected in a more wider context, not only
    for TEXT command, as it should be ... this could explain why (ssget) is accepted then
    as Lisp and evaluated, otherwise, is is taken as literally text input, which fails, of course.

    I would like to ask for sending a support request, please - TEXTEVAL has only to be
    respected by TEXT / MTEXT commands ...

This discussion has been closed.