element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) Mirror a group witha a Command.
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 175 subscribers
  • Views 764 views
  • Users 0 members are here
Related

Mirror a group witha a Command.

Former Member
Former Member over 14 years ago

Hi every one.

I got a problem with "paste" and "mirror".

 

I need to do a panel with 6 i.c. and then change it (with all  it's

layers) to mirror on a specific position. What i could do until now

it's:

 

1.- copy the i.c.

2.- paste it in a similar distance to achieve a panel

3.- group this panel and make a copy to paste it avobe the first

 

this second panel most be mirrored, but it is not, there is not error

message, it just don't get a "mirror" position... have something like

this:

 

 

 

(more like w7 strings above)

 

...

 

 

string w7;                     

    sprintf(w7, "paste (0 %f", By1);

    w7 += ");";

    cmd += w7;

 

       

        cmd += "Display all;\n";

        cmd += "run drill-aid;";

        cmd += "group all;\n";

        cmd += "cut (0 0);\n";

        cmd += "Mirror (0 0);";   

 

  string w8;                   

  sprintf(w8, "paste  (0 %f", By2);       <...................is it ok?

  w8 += ");";                    well, it just don't paste it mirrored 

  cmd += w8;

 

 

    cmd += "Display none;\n";

    cmd += "Display 16 17 20 163;\n";

    cmd += "ratsnest;";

 

 

...

 

 

 

 

Could some body help me?   Please.  image)  

 

 

Thanks.

 

 

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 14 years ago

    On 08/19/2011 06:34 PM, Gerardo Serrano wrote:

    Hi every one.

    I got a problem with "paste" and "mirror".

     

    I need to do a panel with 6 i.c. and then change it (with all  it's

    layers) to mirror on a specific position. What i could do until now

    it's:

     

    1.- copy the i.c.

    2.- paste it in a similar distance to achieve a panel

    3.- group this panel and make a copy to paste it avobe the first

     

    this second panel most be mirrored, but it is not, there is not error

    message, it just don't get a "mirror" position... have something like

    this:

     

    >

     

    (more like w7 strings above)

     

    ...

     

    >

    string w7;                     

        sprintf(w7, "paste (0 %f", By1);

        w7 += ");";

        cmd += w7;

     

           

            cmd += "Display all;\n";

            cmd += "run drill-aid;";

            cmd += "group all;\n";

            cmd += "cut (0 0);\n";

            cmd += "Mirror (0 0);";   

     

    Gerardo,

     

    Try using:

        ...

        group all;            # Groups everything

        cut(0 0);             # Copies the group to the paste buffer

        mirror (C>0 0);       # Mirrors the group

        move (C>0 0) (87 75); # Moves mirrored group to new coords

        paste (0 0);          # pastes the original back at (0 0)

     

    The "C>" designates a Ctrl-Right-Click.  This indicates that you want to

    mirror the group, and not just the object at (0 0).

     

    You can read more about click modifiers in

    <eagleInstallDir>/doc/manual_en.pdf Section 5.2 on page 89 under

    "Right Mouse Click" and "Modifier".

     

    To determined where you want to place the mirrored copy, you can spin

    through the wires on the Dimensions layer (layer 20).  Here's what I use:

     

    real xExtent = 0.0; // maximum X cooridate in the Dimension layer in mils

    real yExtent = 0.0; // maximum Y cooridate in the Dimension layer in mils

    real xMin = 0.0;    // minimum X coordinate in the Dimension Layer in mils

    real yMin = 0.0;    // minimum X coordinate in the Dimension Layer in mils

     

    board(B) {

        int xExtentInt = 0;

        int yExtentInt = 0;

        int xMinInt = 99999999; // some arbitrarily large number

        int yMinInt = 99999999; // some arbitrarily large number

     

        /*

        

    • Look for the wires in the Dimension layer to determine the

        

    • extents of the board.

         */

        B.wires(W) {

            if (W.layer == 20) {

                // Check the maximums

                if (W.x1 > xExtentInt) xExtentInt = W.x1;

                if (W.x2 > xExtentInt) xExtentInt = W.x2;

                if (W.y1 > yExtentInt) yExtentInt = W.y1;

                if (W.y2 > yExtentInt) yExtentInt = W.y2;

     

                // Check the minimums

                if (W.x1 < xMinInt) xMinInt = W.x1;

                if (W.x2 < xMinInt) xMinInt = W.x2;

                if (W.y1 < yMinInt) yMinInt = W.y1;

                if (W.y2 < yMinInt) yMinInt = W.y2;

            }

        }

     

        //

        // Convert the extents from tenths of micrometers to mils

        //

        xExtent = u2mil(xExtentInt);

        yExtent = u2mil(yExtentInt);

        xMin = u2mil(xMinInt);

        yMin = u2mil(yMinInt);

    ...

     

    This leaves the minimum coordinates (lower left) in xMin and yMin, and

    the maximum coordinates in xExtent and yExtent.  Change the conversion

    at the end to whatever units are to be used in your script.

     

    You can then use these extents to position the mirror accurately.  Then

    generating your move becomes:

     

        sprintf(buf, "move (C>0 0) (%f %f);\n", xExtent, yExtent + 100.0);

        cmd += buf;

     

    Be sure to add in some gap in the y-direction to allow you to cut the

    board, as I have done above.

     

    Hope this helps.

     

    Enjoy,

        - Chuck

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 14 years ago

    On 08/19/2011 06:34 PM, Gerardo Serrano wrote:

    Hi every one.

    I got a problem with "paste" and "mirror".

     

    I need to do a panel with 6 i.c. and then change it (with all  it's

    layers) to mirror on a specific position. What i could do until now

    it's:

     

    1.- copy the i.c.

    2.- paste it in a similar distance to achieve a panel

    3.- group this panel and make a copy to paste it avobe the first

     

    this second panel most be mirrored, but it is not, there is not error

    message, it just don't get a "mirror" position... have something like

    this:

     

    >

     

    (more like w7 strings above)

     

    ...

     

    >

    string w7;                     

        sprintf(w7, "paste (0 %f", By1);

        w7 += ");";

        cmd += w7;

     

           

            cmd += "Display all;\n";

            cmd += "run drill-aid;";

            cmd += "group all;\n";

            cmd += "cut (0 0);\n";

            cmd += "Mirror (0 0);";   

     

    Gerardo,

     

    Try using:

        ...

        group all;            # Groups everything

        cut(0 0);             # Copies the group to the paste buffer

        mirror (C>0 0);       # Mirrors the group

        move (C>0 0) (87 75); # Moves mirrored group to new coords

        paste (0 0);          # pastes the original back at (0 0)

     

    The "C>" designates a Ctrl-Right-Click.  This indicates that you want to

    mirror the group, and not just the object at (0 0).

     

    You can read more about click modifiers in

    <eagleInstallDir>/doc/manual_en.pdf Section 5.2 on page 89 under

    "Right Mouse Click" and "Modifier".

     

    To determined where you want to place the mirrored copy, you can spin

    through the wires on the Dimensions layer (layer 20).  Here's what I use:

     

    real xExtent = 0.0; // maximum X cooridate in the Dimension layer in mils

    real yExtent = 0.0; // maximum Y cooridate in the Dimension layer in mils

    real xMin = 0.0;    // minimum X coordinate in the Dimension Layer in mils

    real yMin = 0.0;    // minimum X coordinate in the Dimension Layer in mils

     

    board(B) {

        int xExtentInt = 0;

        int yExtentInt = 0;

        int xMinInt = 99999999; // some arbitrarily large number

        int yMinInt = 99999999; // some arbitrarily large number

     

        /*

        

    • Look for the wires in the Dimension layer to determine the

        

    • extents of the board.

         */

        B.wires(W) {

            if (W.layer == 20) {

                // Check the maximums

                if (W.x1 > xExtentInt) xExtentInt = W.x1;

                if (W.x2 > xExtentInt) xExtentInt = W.x2;

                if (W.y1 > yExtentInt) yExtentInt = W.y1;

                if (W.y2 > yExtentInt) yExtentInt = W.y2;

     

                // Check the minimums

                if (W.x1 < xMinInt) xMinInt = W.x1;

                if (W.x2 < xMinInt) xMinInt = W.x2;

                if (W.y1 < yMinInt) yMinInt = W.y1;

                if (W.y2 < yMinInt) yMinInt = W.y2;

            }

        }

     

        //

        // Convert the extents from tenths of micrometers to mils

        //

        xExtent = u2mil(xExtentInt);

        yExtent = u2mil(yExtentInt);

        xMin = u2mil(xMinInt);

        yMin = u2mil(yMinInt);

    ...

     

    This leaves the minimum coordinates (lower left) in xMin and yMin, and

    the maximum coordinates in xExtent and yExtent.  Change the conversion

    at the end to whatever units are to be used in your script.

     

    You can then use these extents to position the mirror accurately.  Then

    generating your move becomes:

     

        sprintf(buf, "move (C>0 0) (%f %f);\n", xExtent, yExtent + 100.0);

        cmd += buf;

     

    Be sure to add in some gap in the y-direction to allow you to cut the

    board, as I have done above.

     

    Hope this helps.

     

    Enjoy,

        - Chuck

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube