EAGLE Central Forums
Where the EAGLE community meets. Sponsored by Stratford Digital.

Home » CadSoft Support Forums » eagle.suggest.eng » How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons
How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons [message #165816] Thu, 26 May 2016 18:09 Go to next message
Sean Hearder
Messages: 11
Registered: May 2016
Junior Member
I have designed a panel from acrylic. It has switches, buttons, LEDs a LCD screen and back lighting. I saved the panel and then imported to brd as a dxf and use it in dimension layer for board outline etc. I need to cut out a number of holes based on the "holes" in the cad and some circles are NOT holes BUT LED positions. How do i create holes that must be cut out without drawing new polygons and trying to align to the DXF which i imported?

I hope that made sense. I need to be able to select a circle/hole and then create a hole to be cutout. Also i need to use some circles and positions for LEDs.

Thanks in advance

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/197958
Re: How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons [message #165818 is a reply to message #165816] Thu, 26 May 2016 19:42 Go to previous messageGo to next message
warrenbrayshaw
Messages: 1739
Registered: January 2010
Location: New Zealand
Senior Member
On 27/05/2016 6:09 a.m., Sean Hearder wrote:
> I have designed a panel from acrylic. It has switches, buttons, LEDs a LCD screen and back lighting. I saved the panel and then imported to brd as a dxf and use it in dimension layer for board outline etc. I need to cut out a number of holes based on the "holes" in the cad and some circles are NOT holes BUT LED positions. How do i create holes that must be cut out without drawing new polygons and trying to align to the DXF which i imported?
>
> I hope that made sense. I need to be able to select a circle/hole and then create a hole to be cutout. Also i need to use some circles and positions for LEDs.
>
> Thanks in advance
>
> --
> To view any images and attachments in this post, visit:
> https://www.element14.com/community/message/197958
>

Hi Sean

This forum (eagle.suggest.eng) is for making suggestions for changes to
the EagleCad Software.

Please use the support (eagle.support.eng) or the user chat
(eagle.userchat.eng) forums for posts of your nature.

HTH
Warren
Re: How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons [message #165838 is a reply to message #165816] Fri, 27 May 2016 21:29 Go to previous messageGo to next message
rachaelp
Messages: 532
Registered: March 2015
Location: UK
Senior Member
Hi Sean,

I thought this was an interesting query so decided to write a ULP to do this. Save the below as circleToHole.ulp.

> #usage "en: Adds a hole at the location and size of the selected circle\n"
>            "run circleToHole install - to install to the boards context menu"
>
>
> if (argv[1] == "install") {
>     exit("edit .brd; set context circle 'Place hole (Non-PT)...' 'run circleToHole';"
>          "           set context circle 'Place hole (PT)...' 'run circleToHole plated';");
> } else {
>
>    string cmd="";
>
>    if (board) {
>       board(B) {
>          B.circles(C) {
>             if (ingroup(C)) {
>                if (argv[1] == "plated") {
>                   sprintf(cmd, "GRID mil; VIA %f Round 1-16 (%f %f); CHA DRI %f (%f %f);", 2.0 * u2mil(C.radius), u2mil(C.x), u2mil(C.y), 2.0 * u2mil(C.radius), u2mil(C.x), u2mil(C.y));
>                } else {
>                   sprintf(cmd, "GRID mil; HOLE %f (%f %f);", 2.0 * u2mil(C.radius), u2mil(C.x), u2mil(C.y));
>                }
>             }
>          }
>       }
>    }
>
>    exit(cmd);
>
> }
Then in the board do:

     run circleToHole install <return>

Then two context menu items will appear when you right click on circles in imported DXF's relating to hole positions. You can then select to insert a non-plated or a plated hole (which is just a via).

Best Regards,

Rachael

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/198110
Re: How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons [message #165850 is a reply to message #165838] Mon, 30 May 2016 06:10 Go to previous messageGo to next message
Lorenz
Messages: 639
Registered: December 2006
Senior Member
rachaelp wrote:
> I thought this was an interesting query so decided to write a ULP to do this. Save the below as circleToHole.ulp.
> [...]
> sprintf(cmd, "GRID mil; HOLE %f (%f %f);", 2.0 * u2mil(C.radius), u2mil(C.x), u2mil(C.y));

you don't need to mess with the grid settings, just force the unit for
the values:

> sprintf(cmd, "HOLE %fmil (%fmil %fmil);", 2.0 * u2mil(C.radius), u2mil(C.x), u2mil(C.y));
--

Lorenz
Re: How do i create holes based on a DXF i have imported WITHOUT redrawing the polygons [message #165853 is a reply to message #165850] Mon, 30 May 2016 08:59 Go to previous message
rachaelp
Messages: 532
Registered: March 2015
Location: UK
Senior Member
Hi Lorenz, yep that's a good point. I'm still learning ULP at the moment so sometimes I still do things the long way where there is something much more obvious! :-)

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/198219
Previous Topic: How about ODBC support for parts?
Next Topic: Add Attributes capability for ANY element (Wires, tracks, holes, vias etc.)
Goto Forum:
  


Current Time: Wed Apr 26 10:00:58 GMT 2017