×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Change Settings Using VBA

Change Settings Using VBA

Change Settings Using VBA

(OP)
How can I change the following setting using VBA?

Tools > Options > Mechanical Design > Sketcher > 'General Update Errors when the sketch is under-constrained'

I can do it manually. The recorded macro is blank. I could not find any reference to 'Sketcher' tab in the 'Setting Controller Reference in the help file. So I don't know which object and which property to use in the following statement:

CATIA.SettingsControllers.Item("WhichControllerObject").WhichProperty = False

It seems to me, changing settings using code is a tedious job. Is there easier way to find relevant information like above? Is there an easier / alternative way out?

Just an aside, curious to know if anybody knows the total number of settings in CATIA.

RE: Change Settings Using VBA

Hi NirVidP.

I am not good at English, so I wonder if it will be transmitted correctly.

The setting of 'General Update Errors when the sketch is under-constrained' can be switched by the following macro.
(There is no change on the option dialog.
However, the operation is switched.)

CODE --> vba

Sub CATMain()
    
    Dim setctl As SettingControllers
    Set setctl = CATIA.SettingControllers
    
    Dim setPpty As SettingRepository
    Set setPpty = setctl.Item("Sketcher")
    
    'General Update Errors when the sketch is under-constrained
    Dim attr As String
    attr = "DYS_settings_UnderDefUpdateErr"
    
    Dim prm As Variant
    prm = IIf(setPpty.GetAttr(attr), 0, 1)
    
    setPpty.PutAttr (attr), prm
    
    MsgBox ("Done")
    
End Sub 

>Is there easier way to find relevant information like above?
In 'Dumps Parameters values' of the options dialog
Dumping creates a catvbs file,
You can get hints for changing settings.

RE: Change Settings Using VBA

(OP)
Thank you but did not get the solution I wanted.
When I dump the settings for this tab. The .catvbs file is blank.
So, I really want to know how and from where did you find the value 'DYS_settings_UnderDefUpdateErr'. I was not able to find it in the help file either.

RE: Change Settings Using VBA

(OP)
Thank you ferdo, but I am aware of these resources. I posted because but I was not able to find the sketcher tab mentioned in the help.
In the options dialog - Mechnical Design > Sketcher > Sketcher
In the help table, I expected 'Sketcher' to be in the second column of the Mechanical Design solutions row. But it is not there. In fact I can't find the word 'Sketcher' on that page containing the table.

What am I missing?

Or not all the settings exposed?

RE: Change Settings Using VBA

>So, I really want to know how and from where did you find the value 'DYS_settings_UnderDefUpdateErr'.
I found it in a way to dump.
I do not know why your dump is blank.

RE: Change Settings Using VBA

(OP)
Thank you, ferdo, for the info.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close