×
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

macro sectioning in DMU

macro sectioning in DMU

macro sectioning in DMU

(OP)
I want to make a macro that will create a section box in DMU .

 Until now I have this code but is not exactly what I need:

CODE

Sub CATMain()
' Retrieve the Sections collection
Dim cSections As Sections
Set cSections = CATIA.ActiveDocument.Product.GetTechnologicalObject("Sections" [Wink]

    ' Create the master section
    Dim oMasterSection As Section
    Set oMasterSection = cSections.Add

    ' Retrieve data on master section
    Dim Position(11)
    oMasterSection.GetPosition Position

Dim SectionType As CatSectionType
    SectionType = oMasterSection.Type
oMasterSection.Type = catSectionTypeBox

Dim SectionMode As Integer
    SectionMode = oMasterSection.CutMode
oMasterSection.CutMode = 1

Dim SectionWidth As double
    SectionWidth = oMasterSection.Width
oMasterSection.Width = 3500.

Dim SectionHeight As double
    SectionHeight = oMasterSection.Height
oMasterSection.Height = 7000.

Dim SectionThickness As double
    SectionThickness = oMasterSection.Thickness
oMasterSection.Thickness = 600.

    Dim MatrixPos (11) As Double
    MatrixPos( 0) = 1.0
    MatrixPos( 1) = 0.0
    MatrixPos( 2) = 0.0
    MatrixPos( 3) = 0.0
    MatrixPos( 4) = 1.0
    MatrixPos( 5) = 0.0
    MatrixPos( 6) = 0.0
    MatrixPos( 7) = 0.0
    MatrixPos( 8) = 1.0
'is the X component of the origin
    MatrixPos( 9) = 11538.0
'is the Y component of the origin
    MatrixPos(10) = 0.0
'is the Z component of the origin
    MatrixPos(11) = 1750.0
    oMasterSection.SetPosition MatrixPos
End Sub
The problem is that the macro create a section box after the Z axis ( as you can see in the picture attached), but I need it after the X axis.
This is my first macro that I am trying to write ... so I don't know exactly where can I find the neccesary code.
 (I also posted my question at: http://www.coe.org/Collaboration/DiscussionForum/ActiveDiscussions/tabid/210/forumid/6/postid/126920/view/topic/Default.aspx )


Thank you!

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!


Resources