activate sub assembly using toolkit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
-
Toolkit
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I can't found a function for this.
But, I think, it is possible by running a mapkey.
~ Command `ProCmdMakeActive`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, but map key load in between different API doesn't work properly...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Attached code snippet pic for reference. Vector is proper as It is stored in parameter and I have verified the same in debug mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
