×
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

how to dim the sketch according a selected line belongs to

how to dim the sketch according a selected line belongs to

how to dim the sketch according a selected line belongs to

(OP)
before a macro program running, a sketch(different name in different documents,maybe sketch1,sketch2 or sketch3 ) has be opened. I want to do some drawings in the opened sketch, but I don't know how to do next? following is part of my codes:
Sub CATMain()
Dim InputObjectType(0), Status, Selection
Set Selection = CATIA.ActiveDocument.Selection
InputObjectType(0) = "Line2D"
Status = Selection.SelectElement2(InputObjectType, "select a line", True)
If ((Status = "Cancel") Or (Status = "Undo")) Then
MsgBox "case1"
Exit Sub
ElseIf Status = "Redo" Then
Exit Sub
MsgBox "case2"
ElseIf (Status <> "Redo") Then
Set line1 = Selection.Item(1).Value
Dim sketches1 As Sketches
Set sketches1 = CATIA.ActiveDocument.Part.InWorkObject.HybridSketches
????here how to dim the sketch according to the selected line belongs to
...

End If
End Sub

i am newer in macro ,some one can help me? thanks

RE: how to dim the sketch according a selected line belongs to

record a macro and check the result...

Eric N.
indocti discant et ament meminisse periti

RE: how to dim the sketch according a selected line belongs to

CODE --> replace_your_Dim_and_Set_with

Dim sketch1 As Sketch
Set sketch1 = line1.Parent.Parent 

Eric N.
indocti discant et ament meminisse periti

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