Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hello,
I am trying to set up a mapkey that would the following .
- If named view "Iso_01" exists in the list, then activate this view
- If this view does not exists yet, create it with standard angles and then activate it.
I know how to activate a named view, I found some hints concerning "If then else" commands in mapkeys, but I can't find a way to test if the named view exists.
Anyone can help me ?
Thank you !
Solved! Go to Solution.
With some imagination, you can do that:
I have not tested, but I think it should work.
If the view doesn´t exist, it will be saved and activated,
If exists, it will be just activated.
Jose
I'd say it's more trouble than it's worth to do in one mapkey. Create one to show view Iso_01 and another to create it. When invoking the first, if the part doesn't rotate, then invoke the second. Most times you'd only need the first one.
Actually, if all you are doing is starting with a known ortho view, why would it matter if one already existed? You can always pick that one right off the list from the graphics toolbar. Why not create it on the fly with the mapkey?
One thing about the angles accepted by the view dialog... it truncates to 3 places. In my book, this isn't good enough. However, my method would benefit from a mapkey or UDF of some sort.
I create a cubical (equal on all 3 sides) surface; place planes; orient to those planes; delete the features; and save the view. This is accurate to the n-th degree (whatever PTC determines that to be). A follow on from there is to have the view dialog create the other 7 equivalent ISO views. Now you're ready for anything you need in a drawing.
Well, it would save me a few more mapkeys to remember as I'd like to set this for 4 different ISO views.
Also I would then have all my "views" mapkeys on the numpad.
Last, I like to learn new things about Creo.
So if you have any idea I am still interested !
With some imagination, you can do that:
I have not tested, but I think it should work.
If the view doesn´t exist, it will be saved and activated,
If exists, it will be just activated.
Jose
Works great on Creo 2.0
thanks !
It works in Creo2 but doesn't work in the Creo3.
mapkey tx3 @MAPKEY_LABEL ISO Text Note; ~ 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 `17_Note_SEL FILTER`;\
mapkey(continued) @MANUAL_PAUSE Select Note;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\
mapkey(continued) ~ Command `ProCmdEditProperties`
mapkey(continued) ~ FocusOut `note_text_asynch` `txt_note_text`;\
mapkey(continued) ~ Update `note_text_asynch` `txt_note_text` `ISO\nSCALE &view_scale`;\
mapkey(continued) ~ Select `note_text_asynch` `tab_main` 1 `lay_style`;\
mapkey(continued) ~ Activate `note_text_asynch` `chk_usedefheight` 0;\
mapkey(continued) ~ Update `note_text_asynch` `inp_height` `3`;\
mapkey(continued) ~ Update `note_text_asynch` `inp_height` `3`;\
mapkey(continued) ~ Select `note_text_asynch` `tab_main` 1 `lay_style`;\
mapkey(continued) ~ Activate `note_text_asynch` `chk_usedefthickness` 0;\
mapkey(continued) ~ Update `note_text_asynch` `inp_thickness` `.3`;\
mapkey(continued) ~ Activate `note_text_asynch` `psh_color`;~ Activate `tscoldial` `sys0` 1;\
mapkey(continued) ~ Activate `tscoldial` `Ok`;~ FocusOut `note_text_asynch` `txt_note_text`;\
mapkey(continued) ~ Select `note_text_asynch` `opt_horjust` 1 `Center for text style dialog`;\
mapkey(continued) ~ Activate `note_text_asynch` `psh_ok`;;
The Emoticon is (;\) without brackets.
You can erase \nScale &view_scale, I always use the Scale in the iso view, 1/1; 2/1 or 1/2.
Thanks for the reply.
I don't exactly get what this mapkey does step by step. Can you explain a little bit ?
So sorry.
This is the mapkey
mapkey iv @MAPKEY_LABEL ISO View;~ Command `ProCmdNamedViewsGalSelect` `FRONT`;\
mapkey(continued) ~ Command `ProCmdViewOrient` ;~ Open `orient` `SetupOptions`;\
mapkey(continued) ~ Select `orient` `SetupOptions` 1 `dynorient`;\
mapkey(continued) ~ Update `orient` `spinPH.XSpinBox` -30.000000;\
mapkey(continued) ~ Update `orient` `spinPH.YSpinBox` 30.000000;\
mapkey(continued) ~ Update `orient` `spinPH.ZSpinBox` 15.000000;\
mapkey(continued) ~ Activate `orient` `NmViewCheckBtn`1;\
mapkey(continued) ~ Input `orient` `namedviewPH.NameVw_IP` `iso`;\
mapkey(continued) ~ Update `orient` `namedviewPH.NameVw_IP` `iso`;\
mapkey(continued) ~ Activate `orient` `namedviewPH.NameVw_PB_Save`;~ Activate `orient` `OkPB`;;
This Iso View is always related with the Front View.