CogCADFile ClassCognex VisionPro 9.23
Class that reads a CAD file to obtain collections of shapes by using the GetShape... methods, which optionally can connect open shapes into longer contours. A file must be open before using these methods. All splines will be approximated.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro CogCADFile

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 91.0.0.0
Syntax

[SerializableAttribute]
public class CogCADFile : CogObjectBase, ICogNetInternal, 
	IDisposable, ICloneable, ISerializable, ICogHasChanged, ICogChangedEvent

The CogCADFile type exposes the following members.

Constructors

  NameDescription
Public methodCogCADFile 
Constructs a new instance of this class.
Public methodCogCADFile(IntPtr)
Constructs a new instance of this class using com pointer.
Public methodCogCADFile(CogCADFile)
Constructs a new instance of this class as a deep copy of the given instance.
Top
Methods

  NameDescription
Protected methodattachCom
Protected methodClone
Returns a deep copy of this class instance. Derived classes that implement Clone should override this method; other clients who wish to clone this instance should call ICloneable.Clone. See also CogSerializer.DeepCopyObject
Public methodClose
Closes the currently open CAD file if there is one. There is no error if no file is open. This sets FileName to empty string.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose 
Protected methodDispose(Boolean)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Overrides Object Finalize .)
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetGroups
Returns a collection containing the names of all the groups in the currently open CAD file. DXF files sometimes contain named groups of shapes.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLayers
Returns a collection containing the names of all the layers in the currently open CAD file. DXF files are usually constructed with named layers.
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetShapeModels
Gets all shape models from the currently open CAD file. Returns a newly created CogShapeModelCollection. All models have a weight of 1.0 and an undefined polarity. These properties are required for training synthetic PatMax.
Public methodGetShapeModelsFromAGroup
Gets all shape models in the specified group from the currently open CAD file. Returns a newly created CogShapeModelCollection. All models have a weight of 1.0 and an undefined polarity. These properties are required for training synthetic PatMax.
Public methodGetShapeModelsFromALayer
Gets all shape models in the specified layer from the currently open CAD file. Returns a newly created CogShapeModelCollection. All models have a weight of 1.0 and an undefined polarity. These properties are required for training synthetic PatMax.
Public methodGetShapes
Gets all shapes from the currently open CAD file. Returns a newly created CogGraphicCollection.
Public methodGetShapesFromAGroup
Gets all shapes in the specified group from the currently open CAD file. Returns a newly created CogGraphicCollection.
Public methodGetShapesFromALayer
Gets all shapes in the specified layer from the currently open CAD file. Returns a newly created CogGraphicCollection.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone 
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Public methodOpen
Opens a CAD file. Currently only a subset of Autodesk's standard DXF file format is supported. If a file is already open, it will close the file and open a new file or reopen the same file.
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called. Also raises the Changed event if the ChangedEventSuspended count is reduced to zero and any changes were made while events were suspended. Must be called once for each call to SuspendChangedEvent.
Public methodSuspendChangedEvent
Temporarily suspends the raising of the Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Fields

  NameDescription
Protected field__com
Protected field__disposed
Protected fieldStatic member__factory
Protected fieldStatic memberCreator
Public fieldStatic memberSfConnectEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by ConnectEnabled may have changed.
Public fieldStatic memberSfConnectTolerance
This bit will be set in the EventArgs of a Changed event every time the value returned by ConnectTolerance may have changed.
Public fieldStatic memberSfFileName
This bit will be set in the EventArgs of a Changed event every time the value returned by FileName may have changed.
Public fieldStatic memberSfSelectedSpaceName
This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedSpaceName may have changed.
Public fieldStatic memberSfSplineApproximationSpacing
This bit will be set in the EventArgs of a Changed event every time the value returned by SplineApproximationSpacing may have changed.
Public fieldStatic memberSfSplineApproximationTolerance
This bit will be set in the EventArgs of a Changed event every time the value returned by SplineApproximationTolerance may have changed.
Top
Properties

  NameDescription
Public propertyChangedEventSuspended
If nonzero, indicates that the raising of the Changed event has been suspended. This value is incremented when SuspendChangedEvent is called and decremented when ResumeAndRaiseChangedEvent is called.
Public propertyConnectEnabled
If true, it will try to connect open shapes into longer contours which are better for synthetic PatMax. Shapes are connected when the user calls the GetShape... methods. ConnectTolerance is used to control how near shapes must be to be connected.
Public propertyConnectTolerance
Two open contour shapes are connectable if the distance between two of their endpoints is less than this tolerance. Only used if ConnectEnabled is True. This tolerance value is in the same units as the CAD file.
Public propertyFileName
Name of the current open file. If there is no open file, it will return an empty string.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertySelectedSpaceName
Returns/sets the name of the coordinate space for this class, which will be applied to the shapes extracted from the CAD file. The SelectedSpaceName of each extracted shape will be copied from this property.
Public propertySplineApproximationSpacing
All splines in the CAD file will be approximated. Sample points are computed along the spline such that the arc lengths between adjacent sample points do not exceed this spacing. This spacing value is in the the same units as the CAD file.
Public propertySplineApproximationTolerance
All splines in the CAD file will be approximated. Sample points along the spline are guaranteed to be no further than this tolerance from the actual shape. This tolerance value is in the same units as the CAD file.
Top
Events

  NameDescription
Public eventChanged
Occurs when one or more parts of the object's state may have changed.
Top
Remarks

Primary interface of CogCADFile.

See Also