Skip to main content
1-Visitor
November 23, 2014
Solved

Creo 2.0 Mapkey for Iso view

  • November 23, 2014
  • 5 replies
  • 4415 views

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 !

Best answer by Jose_Costa

With some imagination, you can do that:

  1. Create the view first.
  2. Start recording the mapkey
  3. Try to create the view again, with your standard angles
  4. Save the view
  5. A dialog message asking if you want to override the actual view appears, say no.
  6. Activate the desired view
  7. Press ok
  8. Stop recording mapkey

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

5 replies

21-Topaz II
November 23, 2014

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.

17-Peridot
November 23, 2014

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.

12-Amethyst
November 24, 2014

With some imagination, you can do that:

  1. Create the view first.
  2. Start recording the mapkey
  3. Try to create the view again, with your standard angles
  4. Save the view
  5. A dialog message asking if you want to override the actual view appears, say no.
  6. Activate the desired view
  7. Press ok
  8. Stop recording mapkey

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

ccire1-VisitorAuthor
1-Visitor
November 24, 2014

Works great on Creo 2.0

thanks !

1-Visitor
November 24, 2014

It works in Creo2 but doesn't work in the Creo3.

1-Visitor
November 24, 2014

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.

ccire1-VisitorAuthor
1-Visitor
November 24, 2014

Thanks for the reply.

I don't exactly get what this mapkey does step by step. Can you explain a little bit ?

1-Visitor
November 24, 2014

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.