谢谢楼上两位!
1.part_model_item.type的值为PRO_PART,后面我进行了类型转换
status=ProAsmcompConstraintsGet((ProModelitem*)&part_model_item,&p_constraints);
当然,我选择的是装配下的一个零件
2.我试着这样分配内存
ProArrayAlloc(0,sizeof(ProAsmcompconstraint),1,(ProArray*)&p_constraints);
可也还是不对
3.以下是帮助文档的代码
ProError status;
ProSelection* component_arr;
int size;
ProAsmcomp cfeat;
ProMessageDisplay (MSGFIL, "USER Select an assembly component:");
status = ProSelect ("membfeat", 1, NULL, NULL, NULL, NULL, &component_arr, &size);
if (status != PRO_TK_NO_ERROR)
return status;
ProSelectionModelitemGet (component_arr [0], (ProModelitem*)&cfeat);
ProSelectionUnhighlight (component_arr [0]);
ProWindowRepaint (-1);
UserAsmcompConstraintsHighlight (&cfeat);//ProError UserAsmcompConstraintsHighlight (ProAsmcomp* asmcomp)
return PRO_TK_NO_ERROR;
//就算我把
ProModelitem part_model_item;
改成ProAsmcomp cfeat;
也还是不行 |