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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
!<br>
[[Image:create contour2.png|right|Create Contour]]
! 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;&nbsp; start a new part
|-
|!&nbsp;&nbsp;&nbsp; ----------------
|-
|&nbsp;
|-
|new_part "Example.vnc"
|new_part "Example.vnc"
|-
|-
Line 14: Line 23:
|-
|-
|set_part_data units, 1            || ! inches
|set_part_data units, 1            || ! inches
|-
|&nbsp;
|-
|dialog "CreateContour.dlg"
|-
|&nbsp;
|-
|!&nbsp;&nbsp;&nbsp; l1 = long length
|-
|!&nbsp;&nbsp;&nbsp; l2 = short length
|-
|!&nbsp;&nbsp;&nbsp; h1 = long height
|-
|!&nbsp;&nbsp;&nbsp; h2 = short height
|-
|!&nbsp;&nbsp;&nbsp; r1 = large fillet
|-
|!&nbsp;&nbsp;&nbsp; r2 = small fillet
|-
|&nbsp;
|-
|!&nbsp;&nbsp;&nbsp; set the stock size to 25% larger than part all around
|-
|!&nbsp;&nbsp;&nbsp; -----------------------------------------------------
|-
|&nbsp;
|-
|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
|-
|&nbsp;
|-
|set_view top
|-
|zoom_view 0  ||  ! unzoom
|-
|redraw
|-
|&nbsp;
|-
|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
|-
|]
|-
|&nbsp;
|-
|clear_select
|-
|&nbsp;
|-
|redraw
|-
|&nbsp;
|-
|message "Shrinkwrap"
|-
|&nbsp;
|-
|shrink_wrap
|-
|&nbsp;
|-
|message "Finished"
|}
|}
dialog "CreateContour.dlg"<br>
<br>
! l1 = long length<br>
! l2 = short length<br>
! h1 = long height<br>
! h2 = short height<br>
! r1 = large fillet<br>
! r2 = small fillet<br>
<br>
! set the stock size to 25% larger than part all around<br>
! -----------------------------------------------------<br>
<br>
set_part_data stock_x1, -l1*0.25<br>
set_part_data stock_y1, -h1*0.25<br>
set_part_data stock_z1, 0<br>
set_part_data stock_x2, l1*1.25<br>
set_part_data stock_y2, h1*1.25<br>
set_part_data stock_z2, 1<br>
<br>
set_view top<br>
zoom_view 0    ! unzoom<br>
redraw<br>
<br>
contour [<br>
start r1,    0<br>
line  l1-r1, 0<br>
arc  l1-r1, r1,    l1,    r1,    ccw<br>
line  l1,    h2-r2<br>
arc  l1-r2, h2-r2, l1-r2, h2,    ccw<br>
line  l2+r2, h2<br>
arc  l2+r2, h2+r2, l2,    h2+r2, cw<br>
line  l2,    h1-r2<br>
arc  l2-r2, h1-r2, l2-r2, h1,    ccw<br>
line  r1,    h1<br>
arc  r1,    h1-r1, 0,    h1-r1, ccw<br>
line  0,    r1<br>
arc  r1,    r1,    r1,    0,    ccw<br>
]<br>
<br>
clear_select<br>
<br>
redraw<br>
<br>
message "Shrinkwrap"<br>
<br>
shrink_wrap<br>
<br>
message "Finished"<br>

Latest revision as of 16:12, 13 August 2010

Create Contour
Create Contour
!   
!    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"