As many of you know, using the keyboard mapkey to change the selection filter can be a timesaver, especially because the list of entities that can be picked changes depending on what you are doing.
The internal Creo command `ProCmdSelFilterSet` is useful because now mapkey will work regardless of the "work mode" (well, almost).
Use the argument 15 to change the filter to axis entities:
mapkey sax @MAPKEY_NAMESets the selection filter to Axis; @MAPKEY_LABELSelect Axis;\
mapkey(continued) ~ Command `ProCmdSelFilterSet` 15;
In this example, the selection filter is set to "Geometry" by using argument 320002:
mapkey sg @MAPKEY_NAMESelect Geometry;@MAPKEY_LABELSelect Geometry; ~ Command `ProCmdSelFilterSet` 320002;
Through experimenting and by mapkey recording of selecting different filters in different modes of Creo 2.0 (M130),
I compiled a list of "entity types" that can be selected for filtering using the 'ProCmdSelFilterSet' command.
Caveat: this seems to only work during modeling of parts and assemblies.
I found that when I recorded the changing the selection filter in sketcher and drawing modes, the system
recorded the action of picking an item at some position of some list (such mapkeys would only be valid
for that specific mode).
Below is my (probably incomplete) list of entity types.
0 - Feature
1 - Note
2 - Symbol
4 - Parts
8 - Vertex
9 - Edge
10 - Intent Chain
11 - Quilt
13 - Curve
14 - Datum Plane
15 - Axis
16 - coordinate system
17 - datum point
19 - Solid Geometry
25 - Part
34 - Balloon
45 - Gtol
48 - Surface Finish
50 - Symbol
56 - Note
65 - Note
67 - Gtol
68 - Dimension
69 - Dimension
70 - Scan Curve
73 - Reference Entity
77 - Curve
80 - Pipe segment
86 - Facet
87 - Scan Point
90 - Surface
91 - Face Location
93 - Datum Tag
94 - Datum Tag
95 - Datum Tag
96 - Datum Tag
106 - Symbol
107 - Edge
110 - Group
114 - Facet Vertex
118 - Place
123 - Curve Location
128 - Facet Edge
139 - Edge Location
190 - Surface (during round tool)
216 - Scan Curve Location
283 - Annotation Element
291 - Geometry (when picking references for a sketch)
292 - Annotation
318 - Set Datum Tag
329 - Intent Datum Point
330 - Intent Datum Plane
331 - Intent Coordinate System
332 - Intent Datum Axis
352 - Planar Surface
356 - Intent Datum Curve
377 - Datum Target
320002 - Geometry
320003 - Datums
320004 - All
320005 - Surface Regions
Since Creo 7 has added Bodies to the selection paradigm I am attempting to find the number code to use with this approach. I have tried recording the filter selection in drawing mode and part mode but it does not show a numerical tag for body type in the trail file.
Do you know if this config option affects the trail output that contains the numerical tags? I tried with both yes and no and did not see a difference in regards to producing the number code.
This mapkey works but I would prefer to use the `ProCmdSelFilterSet` ##; syntax if possible. Can you offer any insight into the process you used to get the numerical codes?
mapkey qb @MAPKEY_LABELselection filter set body;\ mapkey(continued) ~ Open `main_dlg_cur` `Sst_bar.filter_list`;\ mapkey(continued) ~ Close `main_dlg_cur` `Sst_bar.filter_list`;\ mapkey(continued) ~ Select `main_dlg_cur` `Sst_bar.filter_list` 1 `body_fltr`;
Hi, I'm the original poster, but had since changed my account/username. Anyway, I'm pretty sure I was looking through trail files but I do recall that I had a mapkey that reloads a mapkey defined in a file test_mapkey.pro.
So I was editing my test_mapkey.pro and changing the numerical tag, then reloading via the mapkey. Then I'd see what would show up in Creo's selection filter after I executed the reloaded mapkey.
As you can see by the duplicate entries in my compiled list, this is a total hack, and it was tedious as heck - so I'm glad someone found it useful. Actually, I'm impressed that PTC hasn't changed things and that this ProCmdSelFilterSet method still works in Creo 4.0.
But I don't have Creo 7.0, so I can't try to hack the multi-body related selection items.
Reading your qb mapkey, it does look like the multi-body mode has a similar filter selection structure as the drawing mode and also the flexible-modeling mode. So I get the sense that this is the way modern Creo code works and only the older code uses the ProCmdSelFilterSet methods.
I do hope someone from PTC reads this and enlightens us by providing the list of valid ProCmdSelFilterSet arguments or just tells us how to best do this.
PS. I'm pretty sure you don't need the first two lines in your mapkey. This should work:
mapkey qb @MAPKEY_LABELselection filter set body;\ mapkey(continued) ~ Select `main_dlg_cur` `Sst_bar.filter_list` 1 `body_fltr`;
(I can only guess because I have few 'sst_bar.filter_list... ' lines in my config.pro but none related to multi-bodies)
You are correct that the first two lines are not required for the mapkey to function in Creo 7. I have asked PTC for documentation on syntax for trail files and they have stated that trail files are for development use and they will not provide any documentation to users. I have been asking since the Wildfire migration as the new UI adds tons of extraneous characters to the trail that are superfluous for functionality. If enough people request this through the Technical Committee we might be able to get something from them.
The use of the ProCmdSelFilterSet method is useful as I can write mapkeys in a text editor and not have to spend time recording them and then parsing them down.
I suppose PTC never intended people to edit the "code" generated by the "Record Mapkey" function, otherwise they would have released the relevant documentation.
I don't have access to the technical committees, so I suppose I hope that PTC moderator reads this thread and relays the feedback:
In terms of extensibility, scripting and automation, Creo is rather behind compared to other modern applications (CAD and otherwise). I think PTC needs to provide the user the ability to EASILY create, run, edit and share "plugins" (which are highly functional macros). Just think of MS-Office and Visual Basic for Applications (basically, how Solidworks does it).
Though I like even better how FreeCAD and Python are integrated.