cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Hi, it's possible cancel all dimension in a drawing using a macro?

bragini
10-Marble

Hi, it's possible cancel all dimension in a drawing using a macro?

Hi , i need to cancel or to put on a layer all dimension of a drawing using a Macro.

After of that i ll use probatch to do it on same files.

Thank for your help!!!


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 ACCEPTED SOLUTION

Accepted Solutions

Yes, there are a few ways to do this. One method is to create a rule based layer via a mapkey and then have the mapkey hide (or delete) the dimensions in the layer. I have attached the code to create the layer. You would need to extend it to hide or delete the dimensions. (FYI... mapkey created in Creo 2.0, layer named DIM)


mapkey dl @MAPKEY_LABELDimension Layer;~ Command `ProCmdLayer_NewLay` ;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `d`;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `di`;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `dim`;\

mapkey(continued) ~ Update `newlayerprops` `LayerNameInput` `dim`;\

mapkey(continued) ~ Select `newlayerprops` `PropTab` 1 `RulesDefsettingsLay`;\

mapkey(continued) ~ FocusOut `newlayerprops` `LayerNameInput`;\

mapkey(continued) ~ Activate `newlayerprops` `EditRulesBtn`;\

mapkey(continued) ~ Open `selspecdlg0` `SelOptionRadio`;~ Close `selspecdlg0` `SelOptionRadio`;\

mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio` 1 `Dimension`;\

mapkey(continued) ~ Open `selspecdlg0` `LookByOptionMenu`;\

mapkey(continued) ~ Close `selspecdlg0` `LookByOptionMenu`;\

mapkey(continued) ~ Select `selspecdlg0` `LookByOptionMenu` 1 `Dimension`;\

mapkey(continued) ~ Activate `selspecdlg0` `AddRuleBtn`;\

mapkey(continued) ~ Activate `selspecdlg0` `SelectButton`;\

mapkey(continued) ~ Select `newlayerprops` `RuleOptionsCasc`;\

mapkey(continued) ~ Close `newlayerprops` `RuleOptionsCasc`;\

mapkey(continued) ~ Activate `newlayerprops` `AssocRulesChk` 1;\

mapkey(continued) ~ Activate `newlayerprops` `OkBtn`;

View solution in original post

7 REPLIES 7

Yes, there are a few ways to do this. One method is to create a rule based layer via a mapkey and then have the mapkey hide (or delete) the dimensions in the layer. I have attached the code to create the layer. You would need to extend it to hide or delete the dimensions. (FYI... mapkey created in Creo 2.0, layer named DIM)


mapkey dl @MAPKEY_LABELDimension Layer;~ Command `ProCmdLayer_NewLay` ;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `d`;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `di`;\

mapkey(continued) ~ Input `newlayerprops` `LayerNameInput` `dim`;\

mapkey(continued) ~ Update `newlayerprops` `LayerNameInput` `dim`;\

mapkey(continued) ~ Select `newlayerprops` `PropTab` 1 `RulesDefsettingsLay`;\

mapkey(continued) ~ FocusOut `newlayerprops` `LayerNameInput`;\

mapkey(continued) ~ Activate `newlayerprops` `EditRulesBtn`;\

mapkey(continued) ~ Open `selspecdlg0` `SelOptionRadio`;~ Close `selspecdlg0` `SelOptionRadio`;\

mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio` 1 `Dimension`;\

mapkey(continued) ~ Open `selspecdlg0` `LookByOptionMenu`;\

mapkey(continued) ~ Close `selspecdlg0` `LookByOptionMenu`;\

mapkey(continued) ~ Select `selspecdlg0` `LookByOptionMenu` 1 `Dimension`;\

mapkey(continued) ~ Activate `selspecdlg0` `AddRuleBtn`;\

mapkey(continued) ~ Activate `selspecdlg0` `SelectButton`;\

mapkey(continued) ~ Select `newlayerprops` `RuleOptionsCasc`;\

mapkey(continued) ~ Close `newlayerprops` `RuleOptionsCasc`;\

mapkey(continued) ~ Activate `newlayerprops` `AssocRulesChk` 1;\

mapkey(continued) ~ Activate `newlayerprops` `OkBtn`;

bragini
10-Marble
(To:bragini)

thanks for your help, i've already done a ruled layer but i need to put with the macro the dimension alredy present into a drawing on it (the drawing already exist without the layer and i have to use it with probatch on several drawing).

bragini
10-Marble
(To:bragini)

sorry its perfect !!!!!!!!!!!

The trick is to make the layer rule associative (line 18 in mapkey) so that it adds the existing dimensions to the layer.

If this answers your question, can you mark the post as answered? If not, please let us know what you are still trying to figure out and I will try to help out.

thank yoy the answer is correct how can i mark it as correct answer?

Dale_Rosema
23-Emerald III
(To:bragini)

In the bottom left hand corner of the replies should be a box:

Click on that, and the answer will be marked as correct.

Good day Fabio,

I am so glad you have your solution, thank you Mark Bohannon

Would you please help the community members following this discussion by marking his answer as correct?

Thank you.

Best,

Toby

Top Tags