使用ObjectARX 2012自定实体向导的时候,获取捕捉点的重写函数的向导中模板有点问题,
C:\Program Files (x86)\Autodesk\ObjectARX 2019 Wizards\ArxWizCustomObject\Templates\1033
在ArxWizCustomObject的模板中.object.h和.cpp原来是
virtual Acad::ErrorStatus subGetOsnapPoints ( AcDb::OsnapMode osnapMode, int gsSelectionMark, const AcGePoint3d &pickPoint, const AcGePoint3d &lastPoint, const AcGeMatrix3d &viewXform, AcGePoint3dArray &snapPoints, AcDbIntArray &geomIds) const ; virtual Acad::ErrorStatus subGetOsnapPoints ( AcDb::OsnapMode osnapMode, int gsSelectionMark, const AcGePoint3d &pickPoint, const AcGePoint3d &lastPoint, const AcGeMatrix3d &viewXform, AcGePoint3dArray &snapPoints, AcDbIntArray &geomIds, const AcGeMatrix3d &insertionMat) const ;
其中的第二个参数的类型int gsSelectionMark,在ARX2008开始使用的是,简单修改Adesk::GsMarker gsSelectionMark,
Acad::ErrorStatus [!output CLASS_NAME]::subGetOsnapPoints ( AcDb::OsnapMode osnapMode, Adesk::GsMarker gsSelectionMark, const AcGePoint3d &pickPoint, const AcGePoint3d &lastPoint, const AcGeMatrix3d &viewXform, AcGePoint3dArray &snapPoints, AcDbIntArray &geomIds) const { assertReadEnabled () ; return ([!output BASE_CLASS]::subGetOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds)) ; } Acad::ErrorStatus [!output CLASS_NAME]::subGetOsnapPoints ( AcDb::OsnapMode osnapMode, Adesk::GsMarker gsSelectionMark, const AcGePoint3d &pickPoint, const AcGePoint3d &lastPoint, const AcGeMatrix3d &viewXform, AcGePoint3dArray &snapPoints, AcDbIntArray &geomIds, const AcGeMatrix3d &insertionMat) const { assertReadEnabled () ; return ([!output BASE_CLASS]::subGetOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds, insertionMat)) ; }
这样在ARX2008以上的版本就不会出现捕捉失效的问题.
使用ObjectARX 2012向导生成的自定义实体类无法捕捉的问题解决方式
原文:https://www.cnblogs.com/edata/p/11267413.html