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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

activate sub assembly using toolkit

Ketan_Lalcheta
19-Tanzanite

activate sub assembly using toolkit

Hello

 

I have active assembly in window and i would like to activate sub assembly through toolkit..

 

Is it possible to do same same in pro-toolkit or not? 

 

Thanks and Regards

Ketan

ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

I have assembly having sub assemblies. Just wanted to provide ProAsmcompConstrRedefUI() API for component of sub assembly

 

Suggested API works fine for first level components of assembly. It asks for activation of sub assembly if we need to update component of sub assembly. In manual operation of Creo, Clicking on sub assembly component for redefine activates sub assembly automatically.


AFAIK ProAsmcompConstrRedefUI() works fine. You should check your code which is setting ProAsmcomp from ProAsmcomppath - there must be something wrong there.

View solution in original post

11 REPLIES 11

I can't found a function for this.

But, I think, it is possible by running a mapkey.

~ Command `ProCmdMakeActive`

Yes, but map key load in between different API doesn't work properly...

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

Yes, but map key load in between different API doesn't work properly...


Hello all,

Ketan, a component activation UI command essentially manipulates ProAsmcomppath and subsequently ProSelect or ProReference behind the scenes. Just make a new ProAsmcomppath from ProAsmcomppath of a given component to make a parent subassembly in question to be a new ProAsmcomppath owner and shorten up ProIdTable accordingly.

 

HIH.

FV.

Ketan_Lalcheta
19-Tanzanite
(To:FV)

Thank you for your response.

 

I got your point that we just need to play with Asmcomppath. If I create asmcomppath to first level sub assembly as if it is top level assembly, will it simply activate first level sub assembly. I mean I am not getting what to do next after creating first level sub assembly's asmcomppath so that it gets activated.

 

Thanks again.

 

Regards

Ketan

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)

Ketan, What is your app trying to do? (there is not going to be any 'activation' from the end user standpoint)

 


@Ketan_Lalcheta wrote:

Thank you for your response.

 

I got your point that we just need to play with Asmcomppath. If I create asmcomppath to first level sub assembly as if it is top level assembly, will it simply activate first level sub assembly. I mean I am not getting what to do next after creating first level sub assembly's asmcomppath so that it gets activated.

 

Thanks again.

 

Regards

Ketan


 

Ketan_Lalcheta
19-Tanzanite
(To:FV)

I have assembly having sub assemblies. Just wanted to provide ProAsmcompConstrRedefUI() API for component of sub assembly

 

Suggested API works fine for first level components of assembly. It asks for activation of sub assembly if we need to update component of sub assembly. In manual operation of Creo, Clicking on sub assembly component for redefine activates sub assembly automatically.

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

I have assembly having sub assemblies. Just wanted to provide ProAsmcompConstrRedefUI() API for component of sub assembly

 

Suggested API works fine for first level components of assembly. It asks for activation of sub assembly if we need to update component of sub assembly. In manual operation of Creo, Clicking on sub assembly component for redefine activates sub assembly automatically.


AFAIK ProAsmcompConstrRedefUI() works fine. You should check your code which is setting ProAsmcomp from ProAsmcomppath - there must be something wrong there.

Ketan_Lalcheta
19-Tanzanite
(To:FV)

Thank you for your response. Could you help me with below snippet plz?

 

pObjAsmComp->owner = objAsmCompMdlOwner;
pObjAsmComp->id = vecAsmComp[vecAsmComp.size()-1];//last ID
pObjAsmComp->type = PRO_FEATURE;

 

where, objAsmCompMdlOwner is mdl handle for sub assembly whose component is to be redefined.

            vecAsmComp is a vector having all feature ID (required to have asmcomppath) for a component of sub assembly

 

This is what I have set as asmcomp for sub assembly component.

 

thanks again for your support.

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

Thank you for your response. Could you help me with below snippet plz?

 

pObjAsmComp->owner = objAsmCompMdlOwner;
pObjAsmComp->id = vecAsmComp[vecAsmComp.size()-1];//last ID
pObjAsmComp->type = PRO_FEATURE;

 

where, objAsmCompMdlOwner is mdl handle for sub assembly whose component is to be redefined.

            vecAsmComp is a vector having all feature ID (required to have asmcomppath) for a component of sub assembly

 

This is what I have set as asmcomp for sub assembly component.

 

thanks again for your support.


Ketan, please post the snippet where you have ProAsmcomppath of the component to be redefined as your input. It is impossible to tell from what you had posted if your objAsmCompMdlOwner is correct or if you had copied ProIdTable into std::vector correctly. 

FV.

Ketan_Lalcheta
19-Tanzanite
(To:FV)

Attached code snippet pic for reference. Vector is proper as It is stored in parameter and I have verified the same in debug mode.

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)

Ketan, check your code. You are using exactly the same array index for your component and its parent subassembly. For a component the index is correct: ... .size() - 1, for a parent subassembly the index has to be .size() - 2.

Announcements


Top Tags