Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you alter Tools/Options setting with a macro

Status
Not open for further replies.

Alan Lowbands

Aerospace
May 17, 2017
274
GB
Hi Gents,
Is it possible to over-ride catia Tools/Options settings with a macro ?
I just want to turn on all the dimension manipulators without having to go through the same routine every time I start up a session.

cheers
Alan
 
Replies continue below

Recommended for you

open tools-options, down low you'll find two buttons, one of them is called "Dumps parameter values". another pop-up opens, choose which tab you are interested in. navigate to the saved file, open it...
there you will see all the parameters you can control with script for those options.

regards,
LWolf
 
Hi Gents,
Had to jump off this for a few days but got back to it this morning.
I've had a look and got the settings as you described.
I couldn't understand how you alter them and found a document Infrastucture - Property pages that goes through what you explained.

here's the few first lines-

---------------------------------------------------------------------------------------------------
boolean1 = settingRepository1.GetAttr("ManipMoveLeaderMod")
'--------------------------------------------------
' Parameter 1 : (String) "ManipMoveLeaderMod"
' Returned value : (Variant) (Boolean) False
'--------------------------------------------------

Dim bSTR1
bSTR1 = ""
Dim bSTR2
bSTR2 = ""
Dim boolean2
settingRepository1.GetAttrInfo "ManipMoveLeaderMod", bSTR1, bSTR2, boolean2
'--------------------------------------------------
' Parameter 1 : (String) "ManipMoveLeaderMod"
' Parameter 2 : (String) "Default value"
' Parameter 3 : (String) "Unlocked"
' Parameter 4 : (Boolean) False
'--------------------------------------------------
--------------------------------------------------------------------------------------------------
the document then says you can change the settings using:

Set settingControllers1 = CATIA.SettingControllers
Set generalSessionSettingAtt1 = settingControllers1.Item("CATCafGeneralSessionSettingCtrl")
&
Dim myNewStyle = CATGenUIStyle.UIStyleP1
generalSessionSettingAtt1.UIStyle = myNewStyle

Can anyone tell me how this relates to the settings I want to change?
I don't understand where the switch is :(

any help would be appreciated
regards
Alan
 
Export twice before and after changing the desired location.
I think that you can understand by comparing.
 
Thanks Kantoku,
I have tried that and found the difference between the two but it doesn't help me change the setting.
it's this part of the code that i'm struggling to understand:

Set settingControllers1 = CATIA.SettingControllers
Set settingRepository1 = settingControllers1.Item("DraftingOptions")

and how to use that to change the 'True' / 'False' setting.

cheers
Alan
 
I think the description around here will be helpful.

Link
Link

"GetAttr" is the setting value acquisition, and "PutAttr" is the setting value setting.
 
Thought I had it lol
Can anyone tell me why this sometimes changes the switch and sometime it doesn't ?
I know this is probably well short the correct code but I'm just looking to switch a few different options on/off.


---------------------------------------------------------------------------
Language="VBSCRIPT"
Sub CATMain()

Set settingControllers1 = CATIA.SettingControllers
Set settingRepository1 = settingControllers1.Item("Sketcher")

settingRepository1.PutAttr("DYS_settings_MscNormalToView"), 1

settingRepository1.Commit()

End Sub
-------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top