Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
How to activate the model with Creo Object TOOLKIT C++, which function can be activated?
you can select (put into selection buffer) feature and then run macro to activate model (~ Command `ProCmdMakeActive`)
After running the macro, the Toolkit program will lose control of CREO . So I can't use macros to activate.
I have not used c++ toolkit yet but in jlink there are 2 functions RunMacro (return handle to Creo) and ExecuteMacro (return handle to toolkit app)
if there is no such function in c++ TK you can try this trick:
register 2 commands with these functions;
1. do the stuff you need then run macro to activating the model and running second macro (eg ~ Command `ProCmdMakeActive`; ~ Command `MyCustomCommand`)
2. do the rest what you need
Use ProWindowActivate() to activate the specified window
See application example:
https://www.ptc.com/en/support/article/CS288287
Instead of activating the window, activate the model.
What do you want to do with active model?
To work with the model from the toolkit application, activation of the model is not required.
I want to cut the solid of component B with the quilt of component A .
Now I realize that I don't need to activate the model, but I failed to create the solidify feature because I couldn't select the quilt of component A.
I think, pfcModelItemOwner::ListItems can help you to collect surfaces from A model.
I have collected the quilt, but the creation feature cannot be selected.
You need provide more information about what you are trying to achieve. What you mean by "the creation feature cannot be selected"? Toolkit application must select models A and B, then user must to press button in GUI to create solidify feature?
most likely OP had used ProFeature instead of feature's ProGeomitem while allocating quilt's ProSelection...