Skip to main content
1-Visitor
Nov 28, 2018 6:21 AM UTC
Question

Retrieve constraint of component by toolkit

Hi All,

 

Kindly suggest how to retrieve constraint of a component in assembly by toolkit

 

regards,

MS

5 replies

RPN
18-Opal
Nov 30, 2018 11:31 AM UTC

You should consider to start here:

 

ProAsmcompConstraintsGet (ProAsmcomp *component,ProAsmcompconstraint **pp_constraints );

 

Read ProAsmcomp.h

 

Have fun 🤔

Translate
Manjunath1-VisitorAuthor
1-Visitor
Dec 1, 2018 3:17 AM UTC

Hi RPN,

I used the following code 

	ProError err;
	ProMdl mdl;
	ProSelection* sel;
	int count;
	ProAsmcomp* cmp;
	ProAsmcompconstraint* constr;
	
	err = ProMdlCurrentGet(&mdl);
	err = ProSelect("membfeat",1,NULL,NULL,NULL,NULL,&sel,&count);
	err = ProSelectionModelitemGet(sel[0],(ProModelitem *)cmp);
	err = ProAsmcompConstraintsGet(cmp,&constr);
	return err;

but I could not retrieve the constraints

 

Regards,

Manjunath S

Translate
RPN
18-Opal
Dec 1, 2018 10:46 AM UTC

Sorry, I’m not at my desk, but As far I remember the selection option is invalid. Because  you will get a PRO_FEATURE and not a PRO_PART or PRO_ASSEMBLY

 

Input Arguments:

     component       - The assembly component

 

Component Feature membfeat PRO_FEATURE 
Assemble component model component PRO_PART, PRO_ASSEMBLY

 

Try this

 

err = ProSelect("component",1,NULL,NULL,NULL,NULL,&sel,&count);

Component and Feature ID are the same, you can also set the model item type to PRO_PART or PRO_ASSEMBLY manually in your code, after you have selected the feature, and extracted the model item. But this is the purpose of the „component“ option. 

Translate