Easiest way to add alot of constrained holes from a spread sheet?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Locked
arifzakin38
Posts: 1
Joined: Thu Mar 04, 2021 7:28 pm

Easiest way to add alot of constrained holes from a spread sheet?

Post by arifzakin38 »

Hi! I'm new to CAD and FreeCad.

I'm looking to design a drilling template for work.Basically a rectangle with external dimensions stored in spreadsheet (length, width) and ALOT of 5mm holes in specific places.

The spots where the holes need to be are all stored on a spread sheet.When i first attempted this, i was manually creating circles and manually constraining them.Then i learned about being able to reference a spread sheet, so it's easier to change in future.

After creating ALOT of holes, i googled to see if there might be an easier way.

So i landed at creating a macro to "automate" what i wanted.

After alot of trial and error i got to the snippet of code in the attached picture.



So far it auto matically creates a new circle, constrains the radius to a value in the sheet.

Vertically constrains first circle to "B3"mm from top edge of my object.Horizontally constrains first circle to "D3" from the Y axis centre line.

How do i add more code so the next circle's constraints are "B4" and "D4"

Is the the best way to achieve what i want?
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Easiest way to add alot of constrained holes from a spread sheet?

Post by chrisb »

No image, no file, no FreeCAD infos - no help.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
M4x
Veteran
Posts: 1474
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Easiest way to add alot of constrained holes from a spread sheet?

Post by M4x »

Hint: Follow the big red banner at the top and I'm certain that you'll receive assistance here :)
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Easiest way to add alot of constrained holes from a spread sheet?

Post by chrisb »

It's a spammer. No more effort needed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Easiest way to add alot of constrained holes from a spread sheet?

Post by Olav »

chrisb wrote: Sat Jul 24, 2021 1:58 pm It's a spammer. No more effort needed.
Not so sure. This is a question that was first asked on Reddit:

https://www.reddit.com/r/FreeCAD/commen ... oles_from/

Reddit users often don't seem to understand how forums work unfortunately...
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Easiest way to add alot of constrained holes from a spread sheet?

Post by GeneFC »

Locked.
Locked