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 MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro CogCADFile
Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.0.0.0
Syntax
The CogCADFile type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogCADFile | Constructs a new instance of this class. | |
| CogCADFile(IntPtr) | Constructs a new instance of this class using com pointer. | |
| CogCADFile(CogCADFile) | Constructs a new instance of this class as a deep copy of the given instance. |
Methods
| Name | Description | |
|---|---|---|
| Clone | 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 | |
| Close | 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. | |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| Dispose | ||
| Dispose(Boolean) | ||
| Equals | (Inherited from Object.) | |
| Finalize | (Overrides Object Finalize .) | |
| GetAttributes |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetClassName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetComponentName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetConverter |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultEvent |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultProperty |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEditor |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetGroups | Returns a collection containing the names of all the groups in the currently open CAD file. DXF files sometimes contain named groups of shapes. | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetLayers | Returns a collection containing the names of all the layers in the currently open CAD file. DXF files are usually constructed with named layers. | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData | ||
| GetProperties |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetProperties( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetShapeModels | 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. | |
| GetShapeModelsFromAGroup | 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. | |
| GetShapeModelsFromALayer | 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. | |
| GetShapes | Gets all shapes from the currently open CAD file. Returns a newly created CogGraphicCollection. | |
| GetShapesFromAGroup | Gets all shapes in the specified group from the currently open CAD file. Returns a newly created CogGraphicCollection. | |
| GetShapesFromALayer | Gets all shapes in the specified layer from the currently open CAD file. Returns a newly created CogGraphicCollection. | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| Open | 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. | |
| ResumeAndRaiseChangedEvent | 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. | |
| SuspendChangedEvent | 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. | |
| ToString | (Inherited from Object.) |
Fields
| Name | Description | |
|---|---|---|
| SfConnectEnabled | This bit will be set in the EventArgs of a Changed event every time the value returned by ConnectEnabled may have changed. | |
| SfConnectTolerance | This bit will be set in the EventArgs of a Changed event every time the value returned by ConnectTolerance may have changed. | |
| SfFileName | This bit will be set in the EventArgs of a Changed event every time the value returned by FileName may have changed. | |
| SfSelectedSpaceName | This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedSpaceName may have changed. | |
| SfSplineApproximationSpacing | This bit will be set in the EventArgs of a Changed event every time the value returned by SplineApproximationSpacing may have changed. | |
| SfSplineApproximationTolerance | This bit will be set in the EventArgs of a Changed event every time the value returned by SplineApproximationTolerance may have changed. |
Properties
| Name | Description | |
|---|---|---|
| ChangedEventSuspended | 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. | |
| ConnectEnabled | 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. | |
| ConnectTolerance | 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. | |
| FileName | Name of the current open file. If there is no open file, it will return an empty string. | |
| HasChanged | If true, the serializable state of this object has changed since the last time it was serialized. | |
| SelectedSpaceName | 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. | |
| SplineApproximationSpacing | 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. | |
| SplineApproximationTolerance | 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. |
Events
| Name | Description | |
|---|---|---|
| Changed | Occurs when one or more parts of the object's state may have changed. |
Remarks
Primary interface of CogCADFile.
See Also