Bag Solids: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
|! create 2 solids and put them in and out of the body bag | |! create 2 solids and put them in and out of the body bag | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|a1$ = "This macro will create 2 solids and show" | |a1$ = "This macro will create 2 solids and show" | ||
| Line 8: | Line 8: | ||
|a2$ = "them going in and out of the body bag." | |a2$ = "them going in and out of the body bag." | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|message "%a1$\n%a2$" | |message "%a1$\n%a2$" | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|new_part "Example.vnc" | |new_part "Example.vnc" | ||
| Line 20: | Line 20: | ||
|set_part_data units, 1 | |set_part_data units, 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|set_part_data stock_x1, 0 | |set_part_data stock_x1, 0 | ||
| Line 34: | Line 34: | ||
|set_part_data stock_z2, 1 | |set_part_data stock_z2, 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|set_view iso | |set_view iso | ||
| Line 40: | Line 40: | ||
|zoom_view 0 || ! zoom full | |zoom_view 0 || ! zoom full | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|contour [ | |contour [ | ||
| Line 54: | Line 54: | ||
|] | |] | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|iref = ContourRef | |iref = ContourRef | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|deselect_all_geo | |deselect_all_geo | ||
| Line 66: | Line 66: | ||
|redraw | |redraw | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|extrude 0, 1 | |extrude 0, 1 | ||
| Line 72: | Line 72: | ||
|solref1 = SolidRef | |solref1 = SolidRef | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|deselect_all_geo | |deselect_all_geo | ||
| Line 78: | Line 78: | ||
|delete_shape iref | |delete_shape iref | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|contour [ | |contour [ | ||
| Line 96: | Line 96: | ||
|iref = ContourRef | |iref = ContourRef | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|deselect_all_geo | |deselect_all_geo | ||
| Line 102: | Line 102: | ||
|deselect_all_solids | |deselect_all_solids | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|select_shape iref | |select_shape iref | ||
| Line 110: | Line 110: | ||
|solref2 = SolidRef | |solref2 = SolidRef | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|deselect_all_geo | |deselect_all_geo | ||
| Line 116: | Line 116: | ||
|delete_shape iref | |delete_shape iref | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|redraw | |redraw | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|message "Put the first solid in the bag", "Bag Solids", 1 | |message "Put the first solid in the bag", "Bag Solids", 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|set_solid_bagged solref1, 1 | |set_solid_bagged solref1, 1 | ||
| Line 130: | Line 130: | ||
|redraw | |redraw | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|message "Check the bagged state of the 2 solids", "Bag Solids", 1 | |message "Check the bagged state of the 2 solids", "Bag Solids", 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|get_solid_bagged solref1, bag1 | |get_solid_bagged solref1, bag1 | ||
| Line 140: | Line 140: | ||
|get_solid_bagged solref2, bag2 | |get_solid_bagged solref2, bag2 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|message "Solid 1 bagged = %bag1\nSolid 2 bagged = %bag2", "Bag Solids", 1 | |message "Solid 1 bagged = %bag1\nSolid 2 bagged = %bag2", "Bag Solids", 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|message "Unbag the first solid and bag the second one", "Bag Solids", 1 | |message "Unbag the first solid and bag the second one", "Bag Solids", 1 | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|set_solid_bagged solref1, 0 | |set_solid_bagged solref1, 0 | ||
| Line 156: | Line 156: | ||
|redraw | |redraw | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|stop "Finished" | |stop "Finished" | ||
|- | |- | ||
|} | |} | ||
Latest revision as of 21:06, 29 July 2010
| ! create 2 solids and put them in and out of the body bag | |
| a1$ = "This macro will create 2 solids and show" | |
| a2$ = "them going in and out of the body bag." | |
| message "%a1$\n%a2$" | |
| new_part "Example.vnc" | |
| set_part_data mdd_name, "VMill3a" | |
| set_part_data units, 1 | |
| set_part_data stock_x1, 0 | |
| set_part_data stock_y1, 0 | |
| set_part_data stock_z1, 0 | |
| set_part_data stock_x2, 4 | |
| set_part_data stock_y2, 3 | |
| set_part_data stock_z2, 1 | |
| set_view iso | |
| zoom_view 0 | ! zoom full |
| contour [ | |
| start 0, 0 | |
| line 2, 0 | |
| line 1, 3 | |
| line 0, 0 | |
| ] | |
| iref = ContourRef | |
| deselect_all_geo | |
| select_shape iref | |
| redraw | |
| extrude 0, 1 | |
| solref1 = SolidRef | |
| deselect_all_geo | |
| delete_shape iref | |
| contour [ | |
| start 2, 3 | |
| line 3, 0 | |
| line 4, 3 | |
| line 2, 3 | |
| ] | |
| iref = ContourRef | |
| deselect_all_geo | |
| deselect_all_solids | |
| select_shape iref | |
| extrude 0, 1 | |
| solref2 = SolidRef | |
| deselect_all_geo | |
| delete_shape iref | |
| redraw | |
| message "Put the first solid in the bag", "Bag Solids", 1 | |
| set_solid_bagged solref1, 1 | |
| redraw | |
| message "Check the bagged state of the 2 solids", "Bag Solids", 1 | |
| get_solid_bagged solref1, bag1 | |
| get_solid_bagged solref2, bag2 | |
| message "Solid 1 bagged = %bag1\nSolid 2 bagged = %bag2", "Bag Solids", 1 | |
| message "Unbag the first solid and bag the second one", "Bag Solids", 1 | |
| set_solid_bagged solref1, 0 | |
| set_solid_bagged solref2, 1 | |
| redraw | |
| stop "Finished" |