Category:Examples: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
Mikeo (talk | contribs)
Mikeo (talk | contribs)
Line 47: Line 47:
Show how to move solids into and out of the Body Bag.
Show how to move solids into and out of the Body Bag.
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateSolids <nowiki>Download</nowiki>]<br>
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateSolids <nowiki>Download</nowiki>]<br>
<br>


<br>
<br>
Select one or more faces, on one or more solids. Create a point in the middle of each salected face.
Select one or more faces, on one or more solids. Create a point in the middle of each salected face.
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateFacePoint <nowiki>Download</nowiki>]<br>
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateFacePoint <nowiki>Download</nowiki>]<br>
<br>


<br>
<br>
Line 58: Line 56:
from a point in the middle of each salected face on each selected solid.
from a point in the middle of each salected face on each selected solid.
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateFaceNormal <nowiki>Download</nowiki>]<br>
[https://svn.gibbscam.com/svn/macros/examples/Solids/CreateFaceNormal <nowiki>Download</nowiki>]<br>
<br>


<br>
<br>

Revision as of 17:24, 4 May 2011

Copy any of these macros into a text file (save it with the .mac suffix).
You might want to add the command TRACE ON at the start of the macro to help you follow the macro as it is being executed.


Geometry


Create a simple contour. Uses a dialog to get the contour dimensions. Download


Create a the same contour, then uses a second dialog to get values for a rectangular grid.
Make multiple copies of the contour across the grid pattern. Download


Create a contour, then transform it using Translate, Rotate, Mirror and Scale.
Show simple transforms and also duplicate and transform. Download


Get a list of the selected geometry elements. For each element in the list, find the element type
(line, arc etc) and display the dimensions (start, end, center) of each element. Download


Get a list of the selected geometry elements. create a text file and write out the list of elements including element type and dimensions (start, end, center). Download


Calculate the extents (minimum and maximum X and Y values) of the selected geometry elements. Download


Solids


Create simple solids by Extruding and Revolving a contour. Move these solids and Union them together. Download


Create several simple solids and change each of them to a different type (stock, fixture etc). Display a list of the solids and the type of each one. Download


Show how to move solids into and out of the Body Bag. Download


Select one or more faces, on one or more solids. Create a point in the middle of each salected face. Download


Select one or more faces, on one or more solids. Create a 3D line to represent a surface normal
from a point in the middle of each salected face on each selected solid. Download


Select one or more edges, on one or more solids. Calculate the minimum and maximum XYZ values
of each of the selected edges. Create a 3D wireframe box using these values to enclose the edges. Download

Processes


Create a simple contour. Load a Saved Process. Shrink Wrap and then get the current stock size.
Set the process depths based on the current stock size. Download


Create a simpl contour. Load a Saved process and then set the shape markers. Download


Working with Advanced 3D Processes. Get a list of all current processes.
For each one, show the Advanced 3D process type and display a list of the process data. Download


Working with 5 Axis Processes. Get a list of all current processes.
For each one, show the 5 Axis process type and display a list of the process data. download


Operations


Get a list of selected operations. Create a text file. Get the toolpath associated with each operation.
Output a list of the start and end positions of each line and arc in the toolpath to the text file. Download


Get a list of selected operations. Modify the toolpath associated with each of these operations by splitting
each line and arc in half and adding small moves at 90 degrees to the path at the mid point.operation.
Download


Coordinate Systems


Get the list of current CS's. Create a new CS and then show a list of all CS's, including the new one. Download


Work Groups


Get the list of current WG's. Create a new WG and then show a list of all WG's, including the new one. Download


Part


Check if the currently opened part is Inch or Metric. Ask if it should be changed to the opposite units.
Change it, change the stock size and change the current view to zoom full size. Download


Backup the current part using a filename based on the current part filename (with "_backup" added. Download


Get MTM specific data from the current part. Display the number of flows, toolgroups and spindles. Download


Post Processing


Use a file dialog to ask the user to select a post processor. Use another dialog to ask for an output file.
Show some of the current post parameters (program number, sequence numbers). Change these values and run the post. Download


Use External Applications


Create a text file containing data to be used by an external application.
Run this application (simple Visual Basic application included in this example).
Wait for this application to finish execution (it will read the data file and write a new file).
Read the data from the file created by this applicastion and use it to create a contour. Download

Open an Excel Spreadsheet and read dfata from a range of cells to represent a list of part numbers.
Create a dialog containing this list of part numbers. Use the selected part to get more data from Excel.
use this additional data from Excel to create a contour. Download


Custom Drill Cycles


Custom Drill Cycles require one set of macros for each cycle.
In order to use custom cycles, you must first define the name of the cycle in the MDD.

Each Custom Drill Cycle definition contains the cycle name (seen on the dropdown menu of the drill dialog)
and the cycle folder name. This folder name is used to define the location of the custom macros.

Custom drill cycle macros are located in the Program Data folder, in the folder that is specific to the version of GibbsCAM
that you are running. In here you will find the "Macros\CustomDrillCycles" folder. It is in this folder that you need to create
one folder for each Custom Drill Cycle, using a folder name that matches the custom cycle definition in the MDD.

Each Custom Drill Cycle macro folder must contain the following files (with these exact filenames)
CycleData.txt
CycleData.mac
CycleData.dlg
ToolPath.mac

The first file contains a list of the variables used by the cycle, with default values.
The second file is the macro that is run when you press the Cycle Data button on the Drill Dialog.
The third file is the dialog definition used by the CycleData macro.
The fourth file is used to define the toolpath for each hole in the cycle.

Note: When creating the toolpath, all moves are defined in a CS that has its origin at the start of the hole
and the depth axis pointing along the axis of the hole. So, for example, a hole that is 3 inches deep will contain
moves that start at 0, 0, 0 and have a final depth position of at 0, 0, -3.

The following example macros are available.

Fagor Style Variable Peck Drilling. Input an initial peck depth and a peck reduction amount. The depth of each peck
will be the depth of the previous peck, less the peck reduction amount. A minimum peck depth is also provided for.
An additional cycle option provides for a full out retract after a given number of pecks. Download

This category currently contains no pages or media.