#118 multiple command structure

Minor Effort

Many CAD programs allow commands to be embedded within commands. For example if I wanted to edit a solid using the center of the viewscreen as the keypoint, I could type "keypoint {center}" rather than doing a "center" command and then a "keypoint" command and typing the center coordinates (or highlight and paste). I think an embedded command structure would make BRL-CAD editing much more efficient.


  • Sean Morrison

    Sean Morrison - 2010-11-02

    This feature already exist through the nature that the MGED command prompt is a full Tcl language scripting environment. You can embed commands within arbitrary other commands so long as the outputs match.

    For example, the "center" command reports three numbers and if I were to create a sphere with the "in" command, the format is "in NAME sph X Y Z RADIUS". So I can embed the output of 'center' into the 'in' command as such:

    eval "in obj sph \[center\] 10"

    Looking at the 'obj' object was created, it'll have a V parameter matching whatever the value of [center] was. Almost as simple as predefined symbols like {center} but much more flexible.

    Last detail, if you "set glob_compat_mode 0", you'll can get rid of the slashes so it's just:

    set glob_compat_mode 0
    eval "in obj sph [center] 10"

    If you look at the back of the MGED Quick Reference Card at http://brlcad.org/wiki/Documentation it lists an example of another way you can put Tcl scripting to use.

  • Sean Morrison

    Sean Morrison - 2010-11-02
    • labels: --> Geometry Editing
    • priority: 5 --> 6
    • assigned_to: nobody --> brlcad
    • milestone: --> Minor Effort
    • status: open --> pending-works-for-me
  • Bob Anderson

    Bob Anderson - 2010-11-02

    Thanks again for the information. I've used BRL-CAD for years but have never seen any information discussing the use of an embedded command structure. I will be using it.

  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).


Log in to post a comment.