What's new

Get the coordinates of holes in an Excel

LaurineBodin

New Member
Hello everyone,
I am a beginner on Alibre Design, so I would like to know if anyone can tell me if thanks to this software I can export data in an excel.

My project :
- I create a "table"
- In this board I create several holes of coordinates X and Y, with a depth "D" and a diameter "Di"
- I duplicate some holes without worrying about where I place it
- AD software exports "X", "Y", "D" and "Di" coordinates to an Excel file

So that's what I would like to do. Are there possibilities? Just the X and Y coordinates will be fine for me already. So if there is a function for even more data it does not matter, I will try to arrange myself :)

Thank you in advance,
 
My project :
- I create a "table"
- In this board I create several holes of coordinates X and Y, with a depth "D" and a diameter "Di"
- I duplicate some holes without worrying about where I place it
- AD software exports "X", "Y", "D" and "Di" coordinates to an Excel file
The thing is that the first "3D CAD System" that anyone today would recognize as "3D CAD" (Euclid) has a built in spreadsheet that could (A) be used to generate "Feature coordinates" and (B) generate "Tables of Text." [That was in 1978 no less!] I have arguing for a "recovery" of this capability ever since (just to be clear). Now, the fact is that as somebody who knew Shaun Thornhill (the "kid" who created the modern "workbook" spreadsheet (in 1984) I object to Excel as somebody who remembers how IBM and MIT manipulated things to pirate Shaun's work and how that act of piracy ended up as Excel.

However, WizoScript can be used to create a system (granted that each "use" will have to be "modifed") to "read in" spreadsheet Cell Values to create a Pattern of Entities. Or, if you are willing to "note" Equation Editor values in sufficient detail, generate a worksheet representing said values in an xslx format. Neither "solution" is trivial, but the "first option" is (generally) simpler.
 

swertel

Alibre Super User
At least we can all agree at how bad Excel is and that it shouldn't be used to supplement features in CAD.
 

dwc

Alibre Super User
I have a question, why do you need to export those values?
If you are going to fabricate on a CNC for example, even the simplest CAM programs will write the g-code for you and you don't need to know the x,y values yourself.
I would make my "table" like this.
Use AD to make the model of the board with the holes at the right places.
Export the model in 2D to a dxf file.
With a 2.5D CAM program such as CamBam read in the dxf file.
Define your tools and the only thing you need to do manually is add the depth of the holes to the machine operations.
Have CB make the g-code, done.
Take a bit of time to read the CB doc and you will be saving time at your second use.
 

ajayre

Alibre Super User
This gets you most of the way. Doesn't do the depth, would need to better understand the situation to see if there is a way to do that.

Script:

Code:
# load P:\work\TestPart.AD_PRT
P = Part(r'P:\work', 'TestPart')

# get sketch that defines circles
Sk1 = P.GetSketch("Sketch<1>")

# output CSV
print "X,Y,Diameter"
for Figure in Sk1.Figures:
  if isinstance(Figure, Circle):
    print str(Figure.Center[0]) + "," + str(Figure.Center[1]) + "," + str(Figure.Radius * 2)

Sketch:

Circles.png

Output to script console:

Code:
X,Y,Diameter
0.0,0.0,21.5013949151
0.0,50.0,18.0718113113
50.0,50.0,18.0718113113
50.0,0.0,18.0718113113

That can be copy and pasted into a spreadsheet (Ctrl-C, Ctrl-V, select column A, Data tab -> Text to Columns, comma separated).

Circles-Excel.png

Andy
 
Last edited:

LaurineBodin

New Member
Thanks everyone, for your quick answers!
So I managed to get what I wanted with WizoScript and the code Ajayre: I get well as X, Y and Diameter.

Thanks again and have a nice day !
 
Top