Create Contour.mac: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
New page: !<br> ! create a contour<br> !<br> <br> message "This macro will create a simple contour"<br> <br> ! start a new part<br> ! ----------------<br> <br> {| |new_part "Example.vnc" |- |set_par... |
No edit summary |
||
Line 1: | Line 1: | ||
{| | {| | ||
|- | |||
|! | |||
|- | |||
|! create a contour | |||
|- | |||
|! | |||
|- | |||
|message "This macro will create a simple contour" | |||
|- | |||
| | |||
|! start a new part | |||
|- | |||
|! ---------------- | |||
|- | |||
| | |||
|- | |||
|new_part "Example.vnc" | |new_part "Example.vnc" | ||
|- | |- | ||
Line 14: | Line 21: | ||
|- | |- | ||
|set_part_data units, 1 || ! inches | |set_part_data units, 1 || ! inches | ||
| | |- | ||
dialog "CreateContour.dlg" | | | ||
|- | |||
! l1 = long length | |dialog "CreateContour.dlg" | ||
! l2 = short length | |- | ||
! h1 = long height | | | ||
! h2 = short height | |- | ||
! r1 = large fillet | |! l1 = long length | ||
! r2 = small fillet | |- | ||
|! l2 = short length | |||
! set the stock size to 25% larger than part all around | |- | ||
! ----------------------------------------------------- | |! h1 = long height | ||
|- | |||
set_part_data stock_x1, -l1*0.25 | |! h2 = short height | ||
set_part_data stock_y1, -h1*0.25 | |- | ||
set_part_data stock_z1, 0 | |! r1 = large fillet | ||
set_part_data stock_x2, l1*1.25 | |- | ||
set_part_data stock_y2, h1*1.25 | |! r2 = small fillet | ||
set_part_data stock_z2, 1 | |- | ||
| | |||
set_view top | |- | ||
zoom_view 0 | |! set the stock size to 25% larger than part all around | ||
redraw | |- | ||
|! ----------------------------------------------------- | |||
contour [ | |- | ||
start r1, 0 | | | ||
line l1-r1, 0 | |set_part_data stock_x1, -l1*0.25 | ||
arc l1-r1, r1, l1, r1, ccw | |- | ||
line l1, h2-r2 | |set_part_data stock_y1, -h1*0.25 | ||
arc l1-r2, h2-r2, l1-r2, h2, ccw | |- | ||
line l2+r2, h2 | |set_part_data stock_z1, 0 | ||
arc l2+r2, h2+r2, l2, h2+r2, cw | |- | ||
line l2, h1-r2 | |set_part_data stock_x2, l1*1.25 | ||
arc l2-r2, h1-r2, l2-r2, h1, ccw | |- | ||
line r1, h1 | |set_part_data stock_y2, h1*1.25 | ||
arc r1, h1-r1, 0, h1-r1, ccw | |- | ||
line 0, r1 | |set_part_data stock_z2, 1 | ||
arc r1, r1, r1, 0, ccw | |- | ||
] | | | ||
|set_view top | |||
clear_select | |- | ||
|zoom_view 0 || ! unzoom | |||
redraw | |- | ||
|redraw | |||
message "Shrinkwrap" | |- | ||
| | |||
shrink_wrap | |- | ||
|contour [ | |||
message "Finished" | |- | ||
|start r1, 0 | |||
|- | |||
|line l1-r1, 0 | |||
|- | |||
|arc l1-r1, r1, l1, r1, ccw | |||
|- | |||
|line l1, h2-r2 | |||
|- | |||
|arc l1-r2, h2-r2, l1-r2, h2, ccw | |||
|- | |||
|line l2+r2, h2 | |||
|- | |||
|arc l2+r2, h2+r2, l2, h2+r2, cw | |||
|- | |||
|line l2, h1-r2 | |||
|- | |||
|arc l2-r2, h1-r2, l2-r2, h1, ccw | |||
|- | |||
|line r1, h1 | |||
|- | |||
|arc r1, h1-r1, 0, h1-r1, ccw | |||
|- | |||
|line 0, r1 | |||
|- | |||
|arc r1, r1, r1, 0, ccw | |||
|- | |||
|] | |||
|- | |||
| | |||
|- | |||
|clear_select | |||
|- | |||
| | |||
|- | |||
|redraw | |||
|- | |||
| | |||
|- | |||
|message "Shrinkwrap" | |||
|- | |||
| | |||
|- | |||
|shrink_wrap | |||
|- | |||
| | |||
|- | |||
|message "Finished" | |||
|- |
Revision as of 14:41, 29 July 2010
! | |
! create a contour | |
! | |
message "This macro will create a simple contour" | |
! start a new part | |
! ---------------- | |
new_part "Example.vnc" | |
set_part_data mdd_name, "VMill3a" | ! 3 axis vertical mill |
set_part_data units, 1 | ! inches |
dialog "CreateContour.dlg" | |
! l1 = long length | |
! l2 = short length | |
! h1 = long height | |
! h2 = short height | |
! r1 = large fillet | |
! r2 = small fillet | |
! set the stock size to 25% larger than part all around | |
! ----------------------------------------------------- | |
set_part_data stock_x1, -l1*0.25 | |
set_part_data stock_y1, -h1*0.25 | |
set_part_data stock_z1, 0 | |
set_part_data stock_x2, l1*1.25 | |
set_part_data stock_y2, h1*1.25 | |
set_part_data stock_z2, 1 | |
set_view top | |
zoom_view 0 | ! unzoom |
redraw | |
contour [ | |
start r1, 0 | |
line l1-r1, 0 | |
arc l1-r1, r1, l1, r1, ccw | |
line l1, h2-r2 | |
arc l1-r2, h2-r2, l1-r2, h2, ccw | |
line l2+r2, h2 | |
arc l2+r2, h2+r2, l2, h2+r2, cw | |
line l2, h1-r2 | |
arc l2-r2, h1-r2, l2-r2, h1, ccw | |
line r1, h1 | |
arc r1, h1-r1, 0, h1-r1, ccw | |
line 0, r1 | |
arc r1, r1, r1, 0, ccw | |
] | |
clear_select | |
redraw | |
message "Shrinkwrap" | |
shrink_wrap | |
message "Finished" |