CADFile

This class defines a drawing.

Public Fields

ExtraTypes
static
System.Collections.Generic.List`1[[System.Type, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
Filename
System.String
This is the filename of the current drawing
Layers
CamBam.CAD.LayerCollection
An list of the layers in the drawing.
MachiningOptions
CamBam.CAM.MachiningOptions
Global Machining parameters and defaults
Modified
System.Boolean
Parts
CamBam.CAM.CAMParts
An list of parts in this drawing.
SuspendEvents
System.Boolean
This is used to stop events firing when lots of changes are being made to the drawing.
This helps to imprive performance.
Version
System.String

Properties

ActiveLayer

Layer
The currently active layer. New drawing objects will be added to this layer.

ActiveLayerName

System.String
The name of the active layer.

ActivePart

CamBam.CAM.CAMPart
The currently active layer. New drawing objects will be added to this layer.

ActivePartName

System.String
The name of the active part.

AutoSave
readonly

System.Boolean
 

CacheConflictAction

CamBam.Values.CacheConflictAction
 

Caption
readonly

System.String
 

DefaultExtension
readonly

System.String
The default file extension.

DrawingUnits

CamBam.CAD.Units
 

Name

System.String
The name of the drawing.

OpenFileFilter
readonly

System.String
filter used when opening files.

Scale
readonly

System.Double
Scale document units to mm. For example, use 25.4 if units are inches, 1 if units are mm.

ShortFilename
readonly

System.String
 

ShowCutWidths

System.Boolean
 

ShowDirectionVector

System.Boolean
 

ShowNests

System.Boolean
 

ShowRapids

System.Boolean
 

ShowStock

System.Boolean
 

ShowToolpathNormal

System.Boolean
 

ShowToolpaths

System.Boolean
 

Tag

System.String
 

ToolpathVisibility

CamBam.CAM.ToolpathShowOptions
 

ToolpathVisiblility

CamBam.CAM.ToolpathShowOptions
 

Methods

Add
Void Add (List`1 polys, Layer layer)
Add
Void Add (List`1 entities)
Add
Void Add (List`1 entities, Layer layer)
Add
Void Add (Entity entity)
Add
Void Add (Entity entity, Layer layer)
Add a drawing entity to the current active layer.
Parameters:
prim:
Add
Void Add (List`1 polys)
AddPrimitiveToIndex
Void AddPrimitiveToIndex (Entity prim)
Used internally. Adds a primitive to the drawing's index of primitives.
This does not add the primitive to any layers. Use Add method for that.
Parameters:
prim:
ChangeEntityOrder
Int32 ChangeEntityOrder (Layer layer, Layer newlayer, Int32 fromIndex, Int32 toIndex)
ChangeLayerOrder
Int32 ChangeLayerOrder (Int32 fromIndex, Int32 toIndex)
ChangeMOPOrder
Int32 ChangeMOPOrder (CAMPart part, CAMPart newpart, Int32 fromIndex, Int32 toIndex)
ChangePartOrder
Int32 ChangePartOrder (Int32 fromIndex, Int32 toIndex)
CheckModified
Boolean CheckModified ()
Checks whether the file is modified and prompts whether to save.
Returns: True if the drawing is not modified or the drawing has been saved.
CheckPrimitiveID
Void CheckPrimitiveID (Entity prim)
ClearAll
Void ClearAll ()
Removes all the layers and primitives from a drawing.
Copy
Void Copy (CADFile src)
Make a copy of another CADFile.
Parameters:
gf: Source drawing file.
CreateLayer
Layer CreateLayer (String layername)
Creates a new layer, adds it to the drawing and makes it active.
The name is checked against the user config file to find any default
Layers matching that name.
Parameters:
layername: The name of the layer to create.
Returns:
CreatePart
CAMPart CreatePart (String name)
EnsureActiveLayer
Layer EnsureActiveLayer (Boolean with_undo)
EnsureActivePart
CAMPart EnsureActivePart (Boolean with_undo)
FindPrimitive
Entity FindPrimitive (Int32 ID)
Finds a primitive in the drawing given it's ID.
Parameters:
ID: The ID to find.
Returns: The primitive with the matching ID if found, otherwise null.
FireAfterEntitiesAddedEvent
Void FireAfterEntitiesAddedEvent (List`1 entities)
FireAfterEntitiesAddedEvent
Void FireAfterEntitiesAddedEvent (Entity entity)
FireAfterEntitiesRemovedEvent
Void FireAfterEntitiesRemovedEvent (List`1 entities)
FireAfterEntitiesRemovedEvent
Void FireAfterEntitiesRemovedEvent (Entity entity)
FireAfterMOPsAddedEvent
Void FireAfterMOPsAddedEvent (List`1 mops)
FireAfterMOPsAddedEvent
Void FireAfterMOPsAddedEvent (MachineOp mop)
FireAfterMOPsRemovedEvent
Void FireAfterMOPsRemovedEvent (List`1 mops)
FireAfterMOPsRemovedEvent
Void FireAfterMOPsRemovedEvent (MachineOp mop)
FireBeforeEntitiesAddedEvent
Void FireBeforeEntitiesAddedEvent (List`1 entities)
FireBeforeEntitiesAddedEvent
Void FireBeforeEntitiesAddedEvent (Entity entity)
FireBeforeEntitiesRemovedEvent
Void FireBeforeEntitiesRemovedEvent (List`1 entities)
FireBeforeEntitiesRemovedEvent
Void FireBeforeEntitiesRemovedEvent (Entity entity)
GetExtents
Void GetExtents (PointF& min, PointF& max)
Find the extrema points of all the visible primitives in the drawing.
Parameters:
min: A point that will receive the minimum coordinates.
max: A point that will receive the maximum coordinates.
GetScreenExtents
Void GetScreenExtents (PointF& min, PointF& max, Matrix4x4F t)
HasChanges
Boolean HasChanges ()
HasLayer
Boolean HasLayer (String layername)
Check if a layer exists.
Parameters:
layername:
Returns: True if the drawing contains a layer with this name.
HasPart
Boolean HasPart (String name)
NewFile
Boolean NewFile ()
Creates an empty document with one layer ("DEfault").
Returns: False if the document could not be cleared.
OnModified
Void OnModified ()
Calling this method triggers a DocumentModified event (unless SuspendEvents is true) and
marks the drawing as modified.
Open
Boolean Open ()
Prompts for a filename ten opens a drawing (.cambam) file.
Returns: True if the file was opened successfully.
Open
Boolean Open (String filename)
Open a drawing (.cambam) file.
Parameters:
filename: The name of the file to open.
Returns: True if the file was opened successfully.
PropertyChanged
Void PropertyChanged (String propertyname, Object newvalue)
PropertyChanging
Void PropertyChanging (String propertyname, Object newvalue)
RemovePrimitive
Void RemovePrimitive (Entity entity)
Remove a primitive from the drawing.
Parameters:
prim: The primitive to remove.
RemovePrimitiveID
Void RemovePrimitiveID (Int32 ID)
RemovePrimitives
Void RemovePrimitives (List`1 entities)
Rename
Boolean Rename (String name)
Save
Boolean Save (String filename)
Save the drawing to an alternative filename.
Parameters:
filename: The name of the file to save to.
Returns:
Save
Boolean Save ()
Save the drawing.
Returns: True if the save was successful.
SaveAs
Boolean SaveAs ()
Save the drawing to an alternative filename.
Returns: True if the save was successful.
SetActiveLayer
Void SetActiveLayer (String name)
Set the active layer given it's name.
Parameters:
name: The layer name to make active.
SetActivePart
Void SetActivePart (String name)
Set the active part given it's name.
Parameters:
name: The part name to make active.
ShouldSerializeToolpathVisiblility
Boolean ShouldSerializeToolpathVisiblility ()
Update
Boolean Update ()