SirSkorpan
Mechanical
- Oct 5, 2013
- 7
Hi,
I'm currently learning to program Catia v5 in VBA. I've done a bit of VBA programming before as well as some other languages (Java, C++ and PHP primarily).
At the moment I'm trying to create a toolbar that, among other things, has buttons, which mimic the command buttons in the default Catia toolbar. I've found the CATIA.StartCommand function to be very useful but when it comes to constraints it doesn't work as I expect.
In my script I want to start the Constraint command (the one used to dimension a sketch in the Sketcher workbench). I looked in the command list (view->commands list...) and found "Constraint" for the dimensioning tool and "Constraint..." for the "Constraint box" (the one where you can only put geometrical constraints). I tried with this:
and I also tried writing "c:Constraint" in Catia's command box (not sure what it's called but the box at the bottom where you can write your commands instead of clicking the icons).
None of these attempts give me the Constraint command I'm looking for. Instead if I select the sketch element I want to constrain I get the "Constraint box".
How to I start the "Constraint" command from VBA instead of the "Constraint Box"?
Regards,
Skorpan
I'm currently learning to program Catia v5 in VBA. I've done a bit of VBA programming before as well as some other languages (Java, C++ and PHP primarily).
At the moment I'm trying to create a toolbar that, among other things, has buttons, which mimic the command buttons in the default Catia toolbar. I've found the CATIA.StartCommand function to be very useful but when it comes to constraints it doesn't work as I expect.
In my script I want to start the Constraint command (the one used to dimension a sketch in the Sketcher workbench). I looked in the command list (view->commands list...) and found "Constraint" for the dimensioning tool and "Constraint..." for the "Constraint box" (the one where you can only put geometrical constraints). I tried with this:
Code:
Sub CATMain()
CATIA.StartCommand ("Constraint")
End Sub
and I also tried writing "c:Constraint" in Catia's command box (not sure what it's called but the box at the bottom where you can write your commands instead of clicking the icons).
None of these attempts give me the Constraint command I'm looking for. Instead if I select the sketch element I want to constrain I get the "Constraint box".
How to I start the "Constraint" command from VBA instead of the "Constraint Box"?
Regards,
Skorpan