Strategies to implement multi mode mapkey functionality
A strategy to implement a workaround for the multimode mapkey UI along with an example. This example extends to assembly mode and part mode. This is an implementation of the incremental measure tool as a macro presented in another thread extended to work in part and assembly mode.
Conceptually this executes a nested mapkey sequence that runs commands relevant to part mode and assembly mode in the same mapkey thereby enabling the mapkey functionality in both modes. This example works across part and assembly mode and can be extended to other modes. The non relevant command sequences are ignored by Creo when run so far through all of my testing to date. This sequence does rely on the fact that start parts and assemblies have a def csys of a known name as the searches use string matching to select the projection reference, see text file with the search strings for .fcsa and .fcsp. You can edit the text with your own string to search for def csys in your models.
If anyone else has other approaches to share on this topic please do. If you can "break" this in either part or assembly mode, please report back.
The enclosed text file has the mapkeys included to do the following:
Measure the incremental distance using a csys as projection reference in both part and assembly mode. This mapkey will select either the default csys of an assembly or part to use as the projection reference. This presumes that a relevant def csys is present in one or more models active in session.
mapkey imdi is the top level mapkey which does the following
"imm" calls the measurement tool
selection of the proj ref selection box
".fcsa" to find def asm csys if present
".fcsp" to find def part csys if present
shifts focus to measure refs pick box to enable direct selection by the user of the measurement refs
After invoking mapkey "imdi" and selecting two measure refs you will get the delta measures expressed wrt to the projection CSYS as shown below.