查看单个帖子
旧 2009-04-12, 10:43 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】undo objects in the api

"undo objects" in the api
has anyone developed an addin which creates something new in the sw part and adds it to the undo queue so that it's undo-able by the user?
there's some documentation about undo objects, but i'm not quite sure i understand how it works.
i'm using sw2009 and my addin is developed in c++, but any examples in that language would be best, but i won't be choosy.
pete rimkus
cnc software, inc.
(pete.rimkus@mastercam.com)
hi,
swmodeldocext.startrecordingundoobject
'do the task
swmodeldocext.finishrecordingundoobject ("api undo")
scott,
thanks, but isn't there more than that? i've put that code around some simple isketchmanager::createline() calls and undo is not available afterwards.
the connection between these 2 functions and imodeldocextension::setapiundoobject() is not clear to me...the "startrecording" and "endrecording" functions dont explicitly require that the undoobject or it's handler be defined, but since i have not done that, maybe that's why undo isn't available to me. when i debug finishrecordingundoobject() returns a result of s_false.
if this is the case, exactly what should my handler look like?
if this is not the case, what else might i be doing wrong?
---edited----
more to the point, what would a c++ handler look like?
pete rimkus
cnc software, inc.
(pete.rimkus@mastercam.com)
edited: 11/24/2008 at 02:40 pm by pete rimkus
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)