几何尺寸与公差论坛

 找回密码
 注册
查看: 67|回复: 1

PR 257760 datums will be lost

[复制链接]
发表于 2009-3-30 16:18:45 | 显示全部楼层 |阅读模式
datums will be lost
<< Julio Montoya Barea  --  10/21/08  10:05:57>>
when we create a feature ( perpendicularity) and go back with edit (F9) two times then you will see that we lose the datum. When we run the pp always come a window with a error message.
see example picture and pp
<<END>>


<< Changes made by Yanhua Huang -- 03/28/09  11:15:52>>
Action:  CMM Group to Yanhua Huang
<<END>>
<< Don Turcotte  --  10/22/08  10:56:08>>
The problem here is that when you F9 on a dimension command, PC-DMIS creates a duplicate in case the user selects "Close" instead of "Create".  When "Close" is selected, the duplicate command is used to restore the original command since the user may have made changes to the original which are now being discarded.  When the duplicate is created, command_dialog_init(...) calls duplicate_objects(...) with the last parameter (bForceSerializeAsId) defaulted as true.  This means that the references to the feature commands are serialized using the string id rather than the uid which is unique.  Since in this case the referenced plane has the same name as an alignment, the duplicated object now references the alignment rather than the plane.  I have fixed this be explicitly setting the last parameter in the call to duplicate_objects(...) to FALSE to serialize the feature references using the unique uid.  Now when you select "Close", the dimension command correctly references the plane.
You will have to correct all the corrupted dimensions manually using F9 to select the correct datum feature, then "Create".  Thereafter if you F9 on the dimension and select "Close", the dimension will remain correctly referencing the datum feature.
Fixed in V43B and V44B.
Files inserted to server
------------------------
V43B\SOURCE\GLOBALS.CPP
V44B\SOURCE\GLOBALS.CPP
<<END>>
<< Changes made by Don Turcotte -- 10/22/08  10:56:40>>
Action:  Don Turcotte to CMM Group, Status:  OPEN to REVIEW
<<END>>
<< Don Turcotte  --  10/21/08  17:05:46>>
This occurs when you select Close from the dialog rather than Create when you edit a dimension with F9.  The reason this is occurring is that this program has features with the same name as alignments.  For example, RECHTW1 is the perpendicularity to plane VE_EB_A2.  But this plane feature is immediately followed in the program with an alignment with the very same name.  This is the source of the problem.  I know that PC-DMIS allows the user to use the same name for different features, but using the same name for a feature and an alignment is not recommended.  If you change the name of the plane to, say, VE_EB_A2_PLN, then PC-DMIS will automatically adjust all the commands that use this feature name.  You will still have to F9 on RECHTW1 to fix it since it is currently pointing to the alignment and not the plane.  Once the RECHTW1 dimension is corrected, this problem will not occur again.
I am looking at modifying the "Close" code so that PC-DMIS doesn't grab an alignment when a feature is obviously what is required, but the practice of using the same name for features and alignments (or other non-features) is problematic.
<<END>>
<< Changes made by Tim Wernicke -- 10/21/08  08:18:41>>
Action:  Tim Wernicke to Don Turcotte, Assigned:   to Don Turcotte, Priority:  to Critical
<<END>>
 楼主| 发表于 2009-3-30 16:29:28 | 显示全部楼层

回复: PR 257760 datums will be lost

void command_dialog_init(CPCDpart_program *m_pPartProgram, CDialog * dlg)
{
  // note that this command gets called before the window is available
  if (m_pPartProgram->GetDialogCommand() && (m_pPartProgram->GetDialogCommand()->next || m_pPartProgram->GetDialogCommand()->prev || m_pPartProgram->GetDialogCommand() == m_pPartProgram->GetStartCommand()))
  {
    global_dialog_saved_objects = duplicate_objects(m_pPartProgram, m_pPartProgram->GetDialogCommand(), NULL, &global_dialog_saved_old, &global_dialog_saved_new
      , &global_dialog_saved_count, &global_dialog_saved_deleted, FALSE); // PR257760 - serialize using uid
  }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 17:31 , Processed in 0.038626 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表