Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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!!!
Solved! Go to Solution.
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`;
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`;
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).
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?
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