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 ?

  • What’s the error message? – GisMofx Oct 04 '18 at 01: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 –  Oct 04 '18 at 07:18
  • Have you just tried to use a nested for loop through both the texts collection and then the leaders collection? – GisMofx Oct 04 '18 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 –  Oct 04 '18 at 12:17

1 Answers1

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.

GisMofx
  • 982
  • 9
  • 27
  • 1
    I got an error in doing this but I will try again by changing some lines and I will let you know –  Oct 05 '18 at 06:52
  • @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 – GisMofx Oct 05 '18 at 14:32