Create Contour.mac: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
No edit summary
ConnerO (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Image:create contour2.png|right|Create Contour]]
{|
{|
|-
|-
Line 9: Line 11:
|message "This macro will create a simple contour"
|message "This macro will create a simple contour"
|-
|-
|
| 
|!    start a new part
|!    start a new part
|-
|-
|!    ----------------
|!    ----------------
|-
|-
|
| 
|-
|-
|new_part "Example.vnc"
|new_part "Example.vnc"
Line 22: Line 24:
|set_part_data units, 1            || ! inches
|set_part_data units, 1            || ! inches
|-
|-
|
| 
|-
|-
|dialog "CreateContour.dlg"
|dialog "CreateContour.dlg"
|-
|-
|
| 
|-
|-
|!    l1 = long length
|!    l1 = long length
Line 40: Line 42:
|!    r2 = small fillet
|!    r2 = small fillet
|-
|-
|
| 
|-
|-
|!    set the stock size to 25% larger than part all around
|!    set the stock size to 25% larger than part all around
Line 46: Line 48:
|!    -----------------------------------------------------
|!    -----------------------------------------------------
|-
|-
|
| 
|-
|set_part_data stock_x1, -l1*0.25
|set_part_data stock_x1, -l1*0.25
|-
|-
Line 59: Line 62:
|set_part_data stock_z2, 1
|set_part_data stock_z2, 1
|-
|-
|
| 
|-
|set_view top
|set_view top
|-
|-
Line 66: Line 70:
|redraw
|redraw
|-
|-
|
| 
|-
|-
|contour [
|contour [
Line 98: Line 102:
|]
|]
|-
|-
|
| 
|-
|-
|clear_select
|clear_select
|-
|-
|
| 
|-
|-
|redraw
|redraw
|-
|-
|
| 
|-
|-
|message "Shrinkwrap"
|message "Shrinkwrap"
|-
|-
|
| 
|-
|-
|shrink_wrap
|shrink_wrap
|-
|-
|
| 
|-
|-
|message "Finished"
|message "Finished"
|-
|}

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"