cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Retrieve constraint of component by toolkit

Manjunath
12-Amethyst

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 5
RPN
17-Peridot
17-Peridot
(To:Manjunath)

You should consider to start here:

 

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

 

Read ProAsmcomp.h

 

Have fun 🤔

Manjunath
12-Amethyst
(To:RPN)

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

RPN
17-Peridot
17-Peridot
(To:Manjunath)

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. 

Manjunath
12-Amethyst
(To:RPN)

Hi, 

When i use option "component" I couldn't select a part from sub assembly.

Is there any other way to proceed with this

 

RPN
17-Peridot
17-Peridot
(To:Manjunath)

Ok, use prt_or_asm, this should work.
Top Tags