Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Catia Sectioning with Macro

Status
Not open for further replies.

Ardana Eng

Automotive
Joined
Mar 28, 2022
Messages
1
Location
ID
Dear all, I'm a new user of this forum. Thank you for accepting me.

Please help me to complete my code here. Since I do not have DMU (License), I have to create a custom section with macro. I do not know much about VBA codes as well. For more, please see my attached image and my code below

2022-03-28_110253_qiuhah.png


'DMU_Custom section

Sub CATMain()

Dim Prod As Product
Set Prod = CATIA.ActiveDocument.Product

Dim Sects As Object
Set Sects = Prod.GetTechnologicalObject("Sections")


Call Sects.Add
Dim Sect As Object
Set Sect = Sects.Item(Sects.Count)


'Behavior option
'0-catSectionBehaviorManual
'1-catSectionBehaviorAutomatic
'2-catSectionBehaviorFreeze
Sect.Behavior = 1

'Vol Cut Section
'0-without clipping 1-clipping
Sect.CutMode = 1


'Matrix transformation
Dim MatrixPos(11) As Variant


MatrixPos(0) = 0 'X component of the X-axis (z1)
MatrixPos(1) = 1 'Y component of the X-axis (x1)
MatrixPos(2) = 0 'Z component of the X-axis (y1)

MatrixPos(3) = 0 'X component of the Y-axis (y1)
MatrixPos(4) = 0 'Y component of the Y-axis (z1)
MatrixPos(5) = 1 'Z component of the Y-axis (x1)

MatrixPos(6) = 1 'X component of the Z-axis (x1)
MatrixPos(7) = 0 'Y component of the Z-axis (y1)
MatrixPos(8) = 0 'Z component of the Z-axis (z1)

MatrixPos(9) = -10 'X component of the origin
MatrixPos(10) = 0 'Y component of the origin
MatrixPos(11) = 0 'Z component of the origin
Call Sect.SetPosition(MatrixPos)



End Sub


I would be appreciated if someone can help me.
Thank you. Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top