0

I created a macro That modify property of balloon object in CAT drawing but the problem I cant modify the Point property and it's line (see below )

enter image description here My code :

    myBalloon.Text = Right(myBalloon.Text, 3)
    myBalloon.SetFontSize 0, 0, 2.5
    myBalloon.FrameType = 0

Solution that I tried :

  Dim myview As DrawingView

  Set myview = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.ActiveView

  Dim mytext As DrawingText

  Set mytext = myview.Texts.Item(1)
  Dim myleader As DrawingLeader

  Set myleader = mytext.Leaders.Item(1)
  myleader.HeadSymbol = 0

This works only for 1 point is there away to modify the other points in that Activeview Anyone Can light me on this ?

4
  • What’s the error message? Commented Oct 4, 2018 at 1:25
  • There is no error , the solution works only for one point and I want to modify the other points so I need to create a loop through other point so I can modify them Commented Oct 4, 2018 at 7:18
  • Have you just tried to use a nested for loop through both the texts collection and then the leaders collection? Commented Oct 4, 2018 at 12:12
  • nested ? what do you mean, can provide an example ?if you mean like tested it , I don't knwo wich part that needs to be modified for the loop in order to add the variable for incrementation Commented Oct 4, 2018 at 12:17

1 Answer 1

0

You might want something like this:

Dim myview As DrawingView

  Set myview = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.ActiveView

  Dim mytext As DrawingText
  Dim myleader As DrawingLeader


  For Each mytext In myview.Texts

    For Each myleader In dText.Leaders

        myleader.HeadSymbol = 0

    Next

  Next

The above code is untested, but should be a start for you.

Sign up to request clarification or add additional context in comments.

2 Comments

I got an error in doing this but I will try again by changing some lines and I will let you know
@POLOSTutorials What error and where? Maybe you can update your question with the revised code and a more direct question with regards to the error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.