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!

CATIA Automation (VBA, VB.net), Sketch Constraint "FIX TOGETHER"

Status
Not open for further replies.

MarcoSFO

Aerospace
May 4, 2017
5
DE
Hello,

I have a contour in a CATIA sketch which I would like to move around and rotate. My plan is to fix the geometric elements together to be able to do so without changing the shape of the contour.

Is it possible to create this kind of constraint?
I haven't found anything in AutomationV5.chm and Macro Recording doesn't help neither.

Please help.


Thank you
 
Replies continue below

Recommended for you

Hi

You need to modify according to your needs.

Code:
Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "CATSketchSearch.2DGeometry,all"

CATIA.StartCommand "Fix Together"

End Sub

Regards
Fernando

- Romania
- EU
 
Thank you!

That's a good start I guess but how do i hit the ok button afterwards automatically? The selected items just get referenced in the fix-together command field but it doesn't actually execute the command unless the user hits ok???

Thank you again for your help
 
AppActivate("CATIA")
SendKeys.Send("{ENTER}")

like this or do you have a better idea? thanks
 
And another question, is there a method to rotate geometric elements?
Sometimes I have the Problem that my contour is 90° rotated, which is wrong. Now I have to rotate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top