Create Contour.mac: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
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...
 
ConnerO (talk | contribs)
No edit summary
Line 1: Line 1:
!<br>
! create a contour<br>
!<br>
<br>
message "This macro will create a simple contour"<br>
<br>
! start a new part<br>
! ----------------<br>
<br>
{|
{|
|-
|!&nbsp;&nbsp;&nbsp;
|-
|!&nbsp;&nbsp;&nbsp; create a contour
|-
|!&nbsp;&nbsp;&nbsp;
|-
|message "This macro will create a simple contour"
|-
|
|!&nbsp;&nbsp;&nbsp; start a new part
|-
|!&nbsp;&nbsp;&nbsp; ----------------
|-
|
|-
|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"<br>
|
<br>
|-
! l1 = long length<br>
|dialog "CreateContour.dlg"
! l2 = short length<br>
|-
! h1 = long height<br>
|
! h2 = short height<br>
|-
! r1 = large fillet<br>
|!&nbsp;&nbsp;&nbsp; l1 = long length
! r2 = small fillet<br>
|-
<br>
|!&nbsp;&nbsp;&nbsp; l2 = short length
! set the stock size to 25% larger than part all around<br>
|-
! -----------------------------------------------------<br>
|!&nbsp;&nbsp;&nbsp; h1 = long height
<br>
|-
set_part_data stock_x1, -l1*0.25<br>
|!&nbsp;&nbsp;&nbsp; h2 = short height
set_part_data stock_y1, -h1*0.25<br>
|-
set_part_data stock_z1, 0<br>
|!&nbsp;&nbsp;&nbsp; r1 = large fillet
set_part_data stock_x2, l1*1.25<br>
|-
set_part_data stock_y2, h1*1.25<br>
|!&nbsp;&nbsp;&nbsp; r2 = small fillet
set_part_data stock_z2, 1<br>
|-
<br>
|
set_view top<br>
|-
zoom_view 0     ! unzoom<br>
|!&nbsp;&nbsp;&nbsp; set the stock size to 25% larger than part all around
redraw<br>
|-
<br>
|!&nbsp;&nbsp;&nbsp; -----------------------------------------------------
contour [<br>
|-
start r1,    0<br>
|
line  l1-r1, 0<br>
|set_part_data stock_x1, -l1*0.25
arc  l1-r1, r1,    l1,    r1,    ccw<br>
|-
line  l1,    h2-r2<br>
|set_part_data stock_y1, -h1*0.25
arc  l1-r2, h2-r2, l1-r2, h2,    ccw<br>
|-
line  l2+r2, h2<br>
|set_part_data stock_z1, 0
arc  l2+r2, h2+r2, l2,    h2+r2, cw<br>
|-
line  l2,    h1-r2<br>
|set_part_data stock_x2, l1*1.25
arc  l2-r2, h1-r2, l2-r2, h1,    ccw<br>
|-
line  r1,    h1<br>
|set_part_data stock_y2, h1*1.25
arc  r1,    h1-r1, 0,    h1-r1, ccw<br>
|-
line  0,    r1<br>
|set_part_data stock_z2, 1
arc  r1,    r1,    r1,    0,    ccw<br>
|-
]<br>
|
<br>
|set_view top
clear_select<br>
|-
<br>
|zoom_view 0 ||  ! unzoom
redraw<br>
|-
<br>
|redraw
message "Shrinkwrap"<br>
|-
<br>
|
shrink_wrap<br>
|-
<br>
|contour [
message "Finished"<br>
|-
|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"